Skip to content

Instantly share code, notes, and snippets.

@danbettles
Created May 29, 2012 07:51
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save danbettles/2823177 to your computer and use it in GitHub Desktop.
Save danbettles/2823177 to your computer and use it in GitHub Desktop.
Building JSMin on Linux
#!/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
jsmin <application.js >application.min.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment