Created
March 19, 2017 17:10
-
-
Save saralilyb/41cafc82325d0ee9d02a7ecdecb96ef0 to your computer and use it in GitHub Desktop.
Shell script to compile javascript through Google Closure
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/sh | |
usage(){ | |
echo "Usage: $0 inputfile.js closurecompiledfile.js" | |
exit 1 | |
} | |
is_file_exits(){ | |
local f="$1" | |
[[ -f "$f" ]] && return 0 || return 1 | |
} | |
[[ $# -eq 0 ]] && usage | |
if ( is_file_exits "$1" ) | |
then | |
java -jar ~/src/javascript/closure-compiler-v20170218.jar --js $1 --js_output_file $2 | |
else | |
echo "File not found" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment