Changeset 54f1af8 in github


Ignore:
Timestamp:
Sep 5, 2011 3:59:20 PM (21 months ago)
Author:
thomascube <thomas@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.7, release-0.8
Children:
eb2365c
Parents:
2103032
Message:

Download closure compiler to /tmp instead of current dir

File:
1 edited

Legend:

Unmodified
Added
Removed
  • bin/jsshrink.sh

    r8fc0f94 r54f1af8  
    11#!/bin/sh 
    22JS_DIR=`dirname "$0"`/../program/js 
     3JAR_DIR='/tmp' 
    34CLOSURE_COMPILER_URL='http://closure-compiler.googlecode.com/files/compiler-latest.zip' 
    45 
    56do_shrink() { 
    67        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" 
    89} 
    910 
     
    1112        echo "Directory $JS_DIR not found." 
    1213        exit 1 
     14fi 
     15 
     16if [ ! -w "$JAR_DIR" ]; then 
     17        JAR_DIR=`dirname "$0"` 
    1318fi 
    1419 
     
    2025fi 
    2126 
    22 if [ ! -r "compiler.jar" ]; then 
     27if [ ! -r "$JAR_DIR/compiler.jar" ]; then 
    2328        if which wget >/dev/null 2>&1 && which unzip >/dev/null 2>&1; then 
    2429                wget "$CLOSURE_COMPILER_URL" -O "/tmp/$$.zip" 
     
    2631                curl "$CLOSURE_COMPILER_URL" -o "/tmp/$$.zip" 
    2732        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/." 
    2934                exit 1 
    3035        fi 
    31         unzip "/tmp/$$.zip" "compiler.jar" 
     36        (cd $JAR_DIR && unzip "/tmp/$$.zip" "compiler.jar") 
    3237        rm -f "/tmp/$$.zip" 
    3338fi 
Note: See TracChangeset for help on using the changeset viewer.