Wrote a script "LC.sh" to Download and compile a lambda Calculator to Javascript. Here's the relevant part of the script:
[ ! -f ./compiler-latest.zip ] && echo "Downloading" && \
curl -R -O -L https://dl.google.com/closure-compiler/compiler-latest.zip
[ ! -f ./uni.c ] && echo "Downloading" && \
curl -R -O -L http://tromp.github.io/cl/uni.c
[ ! -f ./compiler.jar ] && echo "Decompressing" && \
unzip compiler-latest.zip compiler.jar
[ ! -f ./LC.js ] && echo "Compiling" && \
emcc -DM=999999 -m32 -std=c99 uni.c -o LC.js
[ ! -f ./LC-min.js ] && echo "Minifying" && \
java -jar compiler.jar --js LC.js --js_output_file LC-min.js
produces the following error:
ERROR - Parse error. IE8 (and below) will parse trailing commas in array and object literals incorrectly. If you are targeting newer versions of JS, set the appropriate language_in option.
Which is overcome by simply deleting the trailing commas and running the script again. Since I don't want others to encounter this, how can I fix this automatically with no manual intervention?