Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 17 lines (14 sloc) 0.46 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#!/bin/bash

# minifies masonry.js
# requires nodejs & uglifyjs

IN=masonry.js
OUT=masonry.min.js

# remove any lines that begin with /*jshint or /*global
# then, minify with Uglify JS
# then, add newline characters after `*/`, but not last newline character
awk '!/^\/\*[jshint|global]/' $IN \
  | uglifyjs \
  | awk '{ORS=""; gsub(/\*\//,"*/\n"); if (NR!=1) print "\n"; print;}' > $OUT
# add trailing semicolon
echo ';' >> $OUT
echo "Minified" $IN "as" $OUT
Something went wrong with that request. Please try again.