Permalink
Browse files

minify.sh : remove jshints

  • Loading branch information...
1 parent d20e781 commit 07e7a1fa5a2503146126dea069ed0440b1032f22 @desandro committed Feb 28, 2012
Showing with 9 additions and 7 deletions.
  1. +9 −7 minify.sh
View
@@ -3,14 +3,16 @@
# minifies jquery.masonry.js
# requires nodejs & uglifyjs
-JS=jquery.masonry.js
-JS_MIN=jquery.masonry.min.js
+IN=jquery.masonry.js
+OUT=jquery.masonry.min.js
-# minify with UglifyJS
+# remove any lines that begin with /*jshint or /*global
+# then, minify with Uglify JS
# then, add newline characters after `*/`, but not last newline character
-uglifyjs $JS \
- | awk '{ORS=""; gsub(/\*\//,"*/\n"); if (NR!=1) print "\n"; print;}' > $JS_MIN
+awk '!/^\/\*[jshint|global]/' $IN \
+ | uglifyjs \
+ | awk '{ORS=""; gsub(/\*\//,"*/\n"); if (NR!=1) print "\n"; print;}' > $OUT
# add trailing semicolon
-echo ';' >> $JS_MIN
-echo "Minified" $JS "as" $JS_MIN
+echo ';' >> $OUT
+echo "Minified" $IN "as" $OUT

0 comments on commit 07e7a1f

Please sign in to comment.