#!/bin/sh if [ -z "$1" ]; then echo "Usage: `basename $0` " echo "Compresses the javascript file and writes the compressed javascript to " exit 1 fi jarpath=`dirname $0`/custom_rhino.jar cat $1 | sed -e "s/^\(\/\*@\|@end\)\(.*\)/window._iecond='\1\2';/g" >/tmp/tmp.js java -jar $jarpath -c /tmp/tmp.js >/tmp/compressed.js cat /tmp/compressed.js | sed -e "s/window._iecond=\"\(.*\)\";/\1/g" >$2