Created
June 11, 2017 00:54
-
-
Save bangpound/50f16b0ce51a175ea5ac9a165c012cfd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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