From: Robert Timm Date: Fri, 7 Apr 2017 22:34:23 +0000 (+0200) Subject: allow directory names in js2h parameters X-Git-Url: https://git.owens.tech/assets/favicon.png/assets/favicon.png/git?a=commitdiff_plain;h=7a2a79f81d870faa3d1bb31978febe0822d08496;p=vimb.git 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 --- 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 | \