mirror of
https://github.com/medialab-prado/datamad2017.git
synced 2024-12-26 12:41:23 +01:00
Merge pull request #54 from gdgistanbul/automation-sh
Script minification bash scripts are added.
This commit is contained in:
commit
9ec3cc60cc
3 changed files with 23 additions and 2 deletions
|
@ -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).
|
||||
|
|
17
automation/minifying/minify_js.sh
Executable file
17
automation/minifying/minify_js.sh
Executable file
|
@ -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
|
4
automation/minifying/minify_scripts_js.sh
Executable file
4
automation/minifying/minify_scripts_js.sh
Executable file
|
@ -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
|
Loading…
Reference in a new issue