Skip to content

Instantly share code, notes, and snippets.

@captbrogers
Created January 16, 2013 17:26
Show Gist options
  • Save captbrogers/4548983 to your computer and use it in GitHub Desktop.
Save captbrogers/4548983 to your computer and use it in GitHub Desktop.
Use a bash script to call YUI Compressor
#!/bin/bash
yui='/usr/bin/yui-compressor/build/yuicompressor-2.4.8pre.jar'
j='/usr/bin/java'
for i in $@
do
filename=${i%.*}
ext=${i##*.}
echo "Compressing $i -> $filename.min.$ext"
$j -jar $yui $i -o $filename.min.$ext
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment