Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMike Gerwitz <gerwitm@lovullo.com>2015-05-31 23:51:08 -0400
committerMike Gerwitz <gerwitm@lovullo.com>2015-05-31 23:51:08 -0400
commit5c2c468183eee8b7926509cfa6a4d80ebd3d9c18 (patch)
tree15d1f3179bbeb4ecd522f8c4b8d90b582cdf8017 /tools
parent0b6e9169243d11082c18d3102ddbaffd7525e6cc (diff)
downloadliza-5c2c468183eee8b7926509cfa6a4d80ebd3d9c18.tar.gz
liza-5c2c468183eee8b7926509cfa6a4d80ebd3d9c18.tar.bz2
liza-5c2c468183eee8b7926509cfa6a4d80ebd3d9c18.zip
ECMAScript 3 compatibility fixes
This is crazy, but LoVullo Associates still supports browsers as far back as IE7, meaning that we need to maintain ES3 support; that will hopefully change soon.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/gen-index20
1 files changed, 17 insertions, 3 deletions
diff --git a/tools/gen-index b/tools/gen-index
index 9c97ef8..85a3d11 100755
--- a/tools/gen-index
+++ b/tools/gen-index
@@ -29,16 +29,30 @@ cat <<EOH
module.exports = {
EOH
+declare -i i
+
# generate require for each module
for module in "$destpath"/!(index).js; do
modname="$( basename "$module" .js )"
- echo " '$modname': require( './$modname' ),"
+
+ # humor ECMAScript 3 for now
+ if ((i++)); then
+ echo ,
+ fi
+
+ echo -n " '$modname': require( './$modname' )"
done
# include index.js for any sub-directories (namespace)
for dir in $( find "$destpath" -maxdepth 1 -mindepth 1 -type d ); do
ns=$( basename "$dir" )
- echo " '$ns': require( './$ns' ),"
+
+ # humor ECMAScript 3 for now
+ if ((i++)); then
+ echo ,
+ fi
+
+ echo -n " '$ns': require( './$ns' )"
done
-echo '};'
+echo -e "\n};"