diff --git a/scripts/check-apply-format-changes.sh b/scripts/check-apply-format-changes.sh index ebe6fbc1ebc694e3a33adf205debb6d632bbb84c..12f8a017e9096fd4557a55462043a2620f33a892 100755 --- a/scripts/check-apply-format-changes.sh +++ b/scripts/check-apply-format-changes.sh @@ -1,5 +1,12 @@ #!/bin/bash +if [[ $# -ne 1 ]]; then + echo "Missing argument! please call this script with either the check or apply argument:" + echo "./scripts/check-apply-format-changes.sh check" + echo "./scripts/check-apply-format-changes.sh apply" + exit -1 +fi + if [[ -z $GIT_CLANG_FORMAT_BIN || -z $CLANG_FORMAT_BIN ]]; then echo "Error: GIT_CLANG_FORMAT_BIN or CLANG_FORMAT_BIN not defined" echo "=> Please follow the instruction at https://redmine.cbm.gsi.de/projects/cbmroot/wiki/Clang-format" @@ -28,13 +35,6 @@ echo "Upstream name is :" $UPSTREAM BASE_COMMIT=$UPSTREAM/master CHANGED_FILES=$(git diff --name-only $BASE_COMMIT | grep -E '.*\.(h|hpp|c|C|cpp|cxx|tpl)$' | grep -viE '.*LinkDef.h$') -if [[ $# -ne 1 ]]; then - echo "Missing argument! please call this script with either the check or apply argument:" - echo "./scripts/check-apply-format-changes.sh check" - echo "./scripts/check-apply-format-changes.sh apply" - exit -1 -fi - case $1 in check) echo "Checking if there are format changes required"