format-source.sh 782 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/sh -ex
  2. # brew install clang-format
  3. CLANG_FORMAT_VERSION=`clang-format -version | awk '{ print $3 }'`
  4. if [[ "$CLANG_FORMAT_VERSION" != "5.0.0" ]]; then
  5. echo "Unsupported clang-format version"
  6. exit 1
  7. fi
  8. pushd "GCDWebServer/Core"
  9. clang-format -style=file -i *.h *.m
  10. popd
  11. pushd "GCDWebServer/Requests"
  12. clang-format -style=file -i *.h *.m
  13. popd
  14. pushd "GCDWebServer/Responses"
  15. clang-format -style=file -i *.h *.m
  16. popd
  17. pushd "GCDWebUploader"
  18. clang-format -style=file -i *.h *.m
  19. popd
  20. pushd "GCDWebDAVServer"
  21. clang-format -style=file -i *.h *.m
  22. popd
  23. pushd "Frameworks"
  24. clang-format -style=file -i *.h *.m
  25. popd
  26. pushd "Mac"
  27. clang-format -style=file -i *.m
  28. popd
  29. pushd "iOS"
  30. clang-format -style=file -i *.h *.m
  31. popd
  32. pushd "tvOS"
  33. clang-format -style=file -i *.h *.m
  34. popd
  35. echo "OK"