From 7a2a79f81d870faa3d1bb31978febe0822d08496 Mon Sep 17 00:00:00 2001 From: Robert Timm Date: Sat, 8 Apr 2017 00:34:23 +0200 Subject: [PATCH] allow directory names in js2h parameters 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 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/scripts/js2h.sh b/src/scripts/js2h.sh index b177085..82903d5 100755 --- a/src/scripts/js2h.sh +++ b/src/scripts/js2h.sh @@ -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 | \ -- 2.20.1