Skip to content

Instantly share code, notes, and snippets.

@sokil
Created January 15, 2016 10:15
Show Gist options
  • Save sokil/2907b8a616457b8b99d7 to your computer and use it in GitHub Desktop.
Save sokil/2907b8a616457b8b99d7 to your computer and use it in GitHub Desktop.
compile_js.sh
#!/bin/bash
# config
jsFilesDir=./../public/js/
compiledJsFilename=compiled.js
# init js files array
js=(
a.js
b.js
)
# create or clear compiled js file
compiledJsFile=${jsFilesDir}${compiledJsFilename}
cat < /dev/null > $compiledJsFile
# compile js files
for i in ${js[@]}
do
jsFile=$jsFilesDir$i
echo Complining $jsFile
java -jar yuicompressor-2.4.7.jar --type js $jsFile >> $compiledJsFile
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment