Skip to content

Instantly share code, notes, and snippets.

@eveevans
Created June 20, 2012 21:22
Show Gist options
  • Save eveevans/2962310 to your computer and use it in GitHub Desktop.
Save eveevans/2962310 to your computer and use it in GitHub Desktop.
download, compile and put jsmin in the path, mode of use: jsmin < application.js >application.min.js
#!/bin/sh
TEMP_DIR="/tmp/jsmin"
SRC_FILENAME="http://www.crockford.com/javascript/jsmin.c"
SRC_BASENAME="jsmin.c"
BIN_BASENAME="jsmin"
BIN_DIR="/bin"
mkdir $TEMP_DIR
cd $TEMP_DIR
curl --output $SRC_BASENAME $SRC_FILENAME
gcc $SRC_BASENAME -o $BIN_BASENAME
cp $BIN_BASENAME $BIN_DIR && echo "$BIN_BASENAME copied to $BIN_DIR"
cd -
rm -rf $TEMP_DIR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment