Created
October 31, 2009 13:58
-
-
Save zerolab/223080 to your computer and use it in GitHub Desktop.
This file contains 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 | |
# 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