Created
March 25, 2011 00:49
-
-
Save yannickcr/886181 to your computer and use it in GitHub Desktop.
A simple shell script to loop through your javascripts and give them to sprocket and uglifyjs
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
SOURCEPATH=/path/to/javascripts/sources | |
BUILDPATH=/path/to/compiled/javascripts | |
NODEPATH=/path/to/node | |
UGLIFYPATH=/path/to/uglifyjs | |
SPROCKETPATH=/path/to/sprocketize | |
cd $SOURCEPATH | |
for f in *.js; | |
do | |
echo "Processing $f file..."; | |
echo "Concatenating..."; | |
$SPROCKETPATH $f > $BUILDPATH/$f; | |
echo "Compressing..."; | |
$NODEPATH $UGLIFYPATH $BUILDPATH/$f > $BUILDPATH/tmp$f; | |
mv $BUILDPATH/tmp$f $BUILDPATH/$f; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment