Changeset 54f1af8 in github
- Timestamp:
- Sep 5, 2011 3:59:20 PM (21 months ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.7, release-0.8
- Children:
- eb2365c
- Parents:
- 2103032
- File:
-
- 1 edited
-
bin/jsshrink.sh (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
bin/jsshrink.sh
r8fc0f94 r54f1af8 1 1 #!/bin/sh 2 2 JS_DIR=`dirname "$0"`/../program/js 3 JAR_DIR='/tmp' 3 4 CLOSURE_COMPILER_URL='http://closure-compiler.googlecode.com/files/compiler-latest.zip' 4 5 5 6 do_shrink() { 6 7 rm -f "$2" 7 java -jar compiler.jar --compilation_level=SIMPLE_OPTIMIZATIONS --js="$1" --js_output_file="$2"8 java -jar $JAR_DIR/compiler.jar --compilation_level=SIMPLE_OPTIMIZATIONS --js="$1" --js_output_file="$2" 8 9 } 9 10 … … 11 12 echo "Directory $JS_DIR not found." 12 13 exit 1 14 fi 15 16 if [ ! -w "$JAR_DIR" ]; then 17 JAR_DIR=`dirname "$0"` 13 18 fi 14 19 … … 20 25 fi 21 26 22 if [ ! -r " compiler.jar" ]; then27 if [ ! -r "$JAR_DIR/compiler.jar" ]; then 23 28 if which wget >/dev/null 2>&1 && which unzip >/dev/null 2>&1; then 24 29 wget "$CLOSURE_COMPILER_URL" -O "/tmp/$$.zip" … … 26 31 curl "$CLOSURE_COMPILER_URL" -o "/tmp/$$.zip" 27 32 else 28 echo "Please download $CLOSURE_COMPILER_URL and extract compiler.jar to this directory."33 echo "Please download $CLOSURE_COMPILER_URL and extract compiler.jar to $JAR_DIR/." 29 34 exit 1 30 35 fi 31 unzip "/tmp/$$.zip" "compiler.jar"36 (cd $JAR_DIR && unzip "/tmp/$$.zip" "compiler.jar") 32 37 rm -f "/tmp/$$.zip" 33 38 fi
Note: See TracChangeset
for help on using the changeset viewer.
