summaryrefslogtreecommitdiff
path: root/script-checker
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2014-03-11 05:06:38 +0100
committerHaru <haru@dotalux.com>2014-03-16 23:21:08 +0100
commit0e58529609ae84540ca340193abf9ca1e8166b72 (patch)
tree28f11daa6e662267e5f1ecd5655cbc46c277c076 /script-checker
parentab878900afdb9c9caa58b7f84f0a12b6283edf2b (diff)
downloadhercules-0e58529609ae84540ca340193abf9ca1e8166b72.tar.gz
hercules-0e58529609ae84540ca340193abf9ca1e8166b72.tar.bz2
hercules-0e58529609ae84540ca340193abf9ca1e8166b72.tar.xz
hercules-0e58529609ae84540ca340193abf9ca1e8166b72.zip
Added --load-script commandline argument
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'script-checker')
-rwxr-xr-xscript-checker19
1 files changed, 14 insertions, 5 deletions
diff --git a/script-checker b/script-checker
index 521cf9025..f4a277e2d 100755
--- a/script-checker
+++ b/script-checker
@@ -14,12 +14,21 @@ if [ -z "$1" ]; then
echo "Usage: $0 <path to the script>"
echo " (you may use a relative or absolute path)"
exit -1
-elif [[ "$1" =~ ^\/ ]]; then
- FILE="$1"
-else
- FILE="${ORIG_CWD}/$1"
fi
if [ ! -x "$EXECUTABLE" ]; then
exit -1
fi
-"$EXECUTABLE" --script-check "${FILE}" 2>&1
+
+while [ -n "$1" ]; do
+ [ -n "$FILES" ] && FILES="${FILES}!"
+ if [[ "$1" =~ ^\/ ]]; then
+ FILES="${FILES}--load-script!$1"
+ else
+ FILES="${FILES}--load-script!${ORIG_CWD}/$1"
+ fi
+ shift
+done
+
+# We assume that filenames don't contain exclamation marks.
+IFS=!
+"$EXECUTABLE" --script-check $FILES 2>&1