From 7f25a9a22d139b8bc017294104a5c58d7e13ea98 Mon Sep 17 00:00:00 2001 From: Said Tahsin Dane Date: Wed, 18 Feb 2015 17:31:10 +0200 Subject: [PATCH 1/2] Script minification bash scripts are added. --- automation/minifying/minify_js.sh | 17 +++++++++++++++++ automation/minifying/minify_scripts_js.sh | 4 ++++ 2 files changed, 21 insertions(+) create mode 100755 automation/minifying/minify_js.sh create mode 100755 automation/minifying/minify_scripts_js.sh diff --git a/automation/minifying/minify_js.sh b/automation/minifying/minify_js.sh new file mode 100755 index 0000000..9323806 --- /dev/null +++ b/automation/minifying/minify_js.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +if [ "$#" -ne 1 ]; then + FILES="../../js"; +else + FILES=$1; +fi + + +for f in $FILES/*.js; +do + if [[ $f != *".min"* ]]; then + echo "Processing $f ..." + echo "java -jar yuicompressor-2.4.8.jar $f -o ${f%.js}.min.js" + java -jar yuicompressor-2.4.8.jar $f -o ${f%.js}.min.js + fi +done \ No newline at end of file diff --git a/automation/minifying/minify_scripts_js.sh b/automation/minifying/minify_scripts_js.sh new file mode 100755 index 0000000..00b8534 --- /dev/null +++ b/automation/minifying/minify_scripts_js.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +echo "Optimizing scripts.js to scripts.min.js" +java -jar yuicompressor-2.4.8.jar ../../js/scripts.js -o ../../js/scripts.min.js \ No newline at end of file From 398a59f88215293b0da4222fd38d3c5723c85aca Mon Sep 17 00:00:00 2001 From: Said Tahsin Dane Date: Wed, 18 Feb 2015 17:38:06 +0200 Subject: [PATCH 2/2] Readme updated to include sh versions --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a13099c..dc4b8aa 100644 --- a/README.md +++ b/README.md @@ -77,9 +77,9 @@ Optimize all images by running this script from `/automation/images/` folder: all_image_optimization.bat -d -jtran -pout -pquant -optip -gsicle -svgo ``` -To minify CSS and JS run `minify_all.bat` from `/automation/minifying/` folder: +To minify CSS and JS run `minify_js.bat` (for Windows) and `minify_js.sh` (for Linux and MacOS) from `/automation/minifying/` folder: ```bash - minify_all.bat + minify_js.bat ``` Learn more about available optimization options from [documentation](https://github.com/gdg-x/zeppelin/wiki/Resources-optimizations).