-
Notifications
You must be signed in to change notification settings - Fork 74
v0.2.51..v0.2.52 changeset UpdateDirCopyrightHeaders.sh
Garret Voltz edited this page Jan 15, 2020
·
1 revision
diff --git a/scripts/copyright/UpdateDirCopyrightHeaders.sh b/scripts/copyright/UpdateDirCopyrightHeaders.sh
index a2b2ba3..7c75f36 100755
--- a/scripts/copyright/UpdateDirCopyrightHeaders.sh
+++ b/scripts/copyright/UpdateDirCopyrightHeaders.sh
@@ -9,7 +9,7 @@ case $# in
0|1)
exit 2 # Need at least two args log filename and search directory
;;
- 2|3)
+ 2|3|4)
if [ ! -d $1 ]; then
exit 12 # Search directory not found
fi
@@ -19,10 +19,24 @@ case $# in
fi
logFilename=$2
if [ $# -eq 3 ]; then
- if [ $3 != '--update' ] && [ $3 != '-u' ]; then
- exit 4 # Unrecognized update argument
+ if [ $3 == '--update' ] || [ $3 == '-u' ]; then
+ updateMode=1
+ elif [ $3 == '--debug' ] || [ $3 == '-d' ]; then
+ debugMode='--debug'
else
+ exit 4 # Unrecognized argument
+ fi
+ fi
+ if [ $# -eq 4 ]; then
+ if [ $3 == '--update' ] || [ $4 == '--update' ] || [ $3 == '-u' ] || [ $4 == '-u' ]; then
updateMode=1
+ else
+ exit 4 # Unrecognized argument
+ fi
+ if [ $3 == '--debug' ] || [ $4 == '--debug' ] || [ $3 == '-d' ] || [ $4 == '-d' ]; then
+ debugMode='--debug'
+ else
+ exit 4 # Unrecognized argument
fi
fi
;;
@@ -32,7 +46,7 @@ case $# in
esac
cd $searchDir
-find . -type f -and \( \( -name \*.js -or -name \*.java -or -name \*.cpp -or -name \*.h \) -and -not \( -wholename \*/db2/\* -or -wholename \*/target/\* -or -wholename \*/tmp/\* -or -name \*.pb.h -or -wholename \*/schema/__init__.js -or -wholename \*/etds\*/__init__.js \) \) -exec $HOOT_HOME/scripts/copyright/UpdateCopyrightHeader.py --copyright-header=$LICENSE_TEMPLATE --file={} --update-mode=$updateMode \; >> $logFilename
+find . -type f -and \( \( -name \*.js -or -name \*.java -or -name \*.cpp -or -name \*.h \) -and -not \( -wholename \*/db2/\* -or -wholename \*/target/\* -or -wholename \*/tmp/\* -or -name \*.pb.h -or -wholename \*/schema/__init__.js -or -wholename \*/etds\*/__init__.js \) \) -exec $HOOT_HOME/scripts/copyright/UpdateCopyrightHeader.py --copyright-header=$LICENSE_TEMPLATE --file={} --update-mode=$updateMode $debugMode \; >> $logFilename
cd ..
echo "Complete: $searchDir"