Skip to content

Instantly share code, notes, and snippets.

@danbeam
Created June 14, 2011 23:36
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 danbeam/1026192 to your computer and use it in GitHub Desktop.
Save danbeam/1026192 to your computer and use it in GitHub Desktop.
Only $19 if you order today!
#!/bin/bash
DIR=${1:-.};
if [ -z "$YUI" -o ! -r "$YUI" ]; then
echo "You need the path to YUI Compressor as env var \$YUI";
exit 1;
fi
for CSS in `find $DIR -type f -name *.css`; do
java -jar $YUI --type css -o ${CSS%.css}.min.css $CSS;
done
for JS in `find $DIR -type f -name *.js`; do
java -jar $YUI --type js -o ${JS%.js}.min.js $JS;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment