summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2015-02-07 20:14:58 +0100
committerThomas Bruederli <bruederli@kolabsys.com>2015-02-07 20:14:58 +0100
commit96dee98e7fd658e05ad3b0576c186fd5af89e7b2 (patch)
tree9b6902b9067c6bcb67a1c06f8782bb3ce5e3e520
parent40a37adc22d10013507ff45375ca21e105f36081 (diff)
Copy the first comment block with license information for LibreJS when minifying
-rwxr-xr-xbin/jsshrink.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/bin/jsshrink.sh b/bin/jsshrink.sh
index f7c7b22e9..0890a5c40 100755
--- a/bin/jsshrink.sh
+++ b/bin/jsshrink.sh
@@ -9,7 +9,9 @@ CLOSURE_COMPILER_URL='http://dl.google.com/closure-compiler/compiler-20131014.zi
do_shrink() {
rm -f "$2"
- java -jar $JAR_DIR/compiler.jar --compilation_level=SIMPLE_OPTIMIZATIONS --js="$1" --js_output_file="$2" --language_in="$3"
+ # copy the first comment block with license information for LibreJS
+ grep -q '@lic' $1 && sed -n '/\/\*/,/\*\// { p; /\*\//q; }' $1 > $2
+ java -jar $JAR_DIR/compiler.jar --compilation_level=SIMPLE_OPTIMIZATIONS --js="$1" --language_in="$3" >> $2
}
if [ ! -d "$JS_DIR" ]; then