2
0

git-cl.sh 348 B

1234567891011121314151617181920
  1. #!/bin/sh
  2. # Copyright The OpenTelemetry Authors
  3. # SPDX-License-Identifier: Apache-2.0
  4. set -e
  5. if [ "format" = "$1" ]; then
  6. if [ -z "$2" ]; then
  7. echo Please specify file name.
  8. exit
  9. fi
  10. if [ -f "$2" ]; then
  11. FILEPATH=$2
  12. else
  13. FILEPATH=${GIT_PREFIX}$2
  14. fi
  15. echo Formatting $FILEPATH
  16. clang-format -style=file -i $FILEPATH
  17. fi