Skip to content

Instantly share code, notes, and snippets.

@zerolab
Created October 31, 2009 13:58
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 zerolab/223080 to your computer and use it in GitHub Desktop.
Save zerolab/223080 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Author : Dan Braghis <dan [at] zerolab.org>
# Date : 31/10/2009
# depends: java, yuicompressor
# varsion: 1.0
# Minifies the selected files using YUI Compressor (http://developer.yahoo.com/yui/compressor/).
# The script assumes yuicompressor.jar is located in /opt/
IFS='
'
for file in $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS
do
if [ -f "$file" ]; then
base=${file%.*}
ext=${file##*.}
newname=${base}.min.${ext}
java -jar /opt/yuicompressor.jar $file -o $newname
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment