Skip to content
Snippets Groups Projects
Commit a058276b authored by Pierre-Alain Loizeau's avatar Pierre-Alain Loizeau
Browse files

In check format scripts, move argument number check to top

parent bb01b3b2
No related branches found
No related tags found
No related merge requests found
#!/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"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment