allow directory names in js2h parameters
authorRobert Timm <mail@rtti.de>
Fri, 7 Apr 2017 22:34:23 +0000 (00:34 +0200)
committerRobert Timm <mail@rtti.de>
Fri, 7 Apr 2017 22:34:23 +0000 (00:34 +0200)
strips directory names from js2h js file parameters. this allows
calling js2h from directories other than one the js source resides in

src/scripts/js2h.sh

index b177085..82903d5 100755 (executable)
@@ -13,9 +13,9 @@ if [ ! -r "$FILE" ]; then
     exit 1
 fi
 
-# Remove the .js file extension and turn all chars to upper case to get the
-# constant name.
-CONSTANT=$(echo "$FILE" | sed 's:.js$::g' | tr a-z A-Z)
+# Remove the path and .js file extension and turn all chars to upper case to
+# get the constant name.
+CONSTANT=$(echo "$FILE" | sed 's:.*/::g' | sed 's:.js$::g' | tr a-z A-Z)
 
 # minify the script
 cat $FILE | \