Skip to content

Instantly share code, notes, and snippets.

@bangpound
Created June 11, 2017 00:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bangpound/50f16b0ce51a175ea5ac9a165c012cfd to your computer and use it in GitHub Desktop.
Save bangpound/50f16b0ce51a175ea5ac9a165c012cfd to your computer and use it in GitHub Desktop.
#!/bin/bash
[ -d ac_global/jsc ] || mkdir ac_global/jsc
[ -d admin/jsc ] || mkdir admin/jsc
closure_compile() {
temp="${1%\'}"
temp="${temp#\'}"
list=()
js=$(jq --raw-output '.["'"$temp"'"] | @sh' < tools/compilejs.json)
for f in $js
do
list+=("--js=$f ")
done
echo ${list[@]}
java -jar ~/closure-compiler/closure-compiler-v20170521.jar ${list[@]} --js_output_file "${temp}"
}
closure_compiler_check() {
list=()
for f in ${1}
do
list+=("--js=$f ")
done
java -jar ~/closure-compiler/closure-compiler-v20170521.jar ${list[@]} --checks-only -W DEFAULT
}
#files=$(jq --raw-output '. | flatten | unique | @sh' < tools/compilejs.json)
#closure_compiler_check "${files}"
for i in $(jq --raw-output 'keys | @sh' < tools/compilejs.json);
do
closure_compile "${i}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment