diff options
| author | Gubolin <gubolin@fantasymail.de> | 2014-09-07 16:47:36 +0200 |
|---|---|---|
| committer | Gubolin <gubolin@fantasymail.de> | 2014-09-07 16:47:36 +0200 |
| commit | 468fb94a5fb17218da16033e27e86c1219c2b3ec (patch) | |
| tree | ca816064daf663986313b5d77a819339f93b96e5 /binary.sh | |
| parent | 1dfd7f773ed3f78e65a1022e0b35858d4358ed28 (diff) | |
| download | snap-468fb94a5fb17218da16033e27e86c1219c2b3ec.tar.gz snap-468fb94a5fb17218da16033e27e86c1219c2b3ec.zip | |
add script for compressing Snap\!
Diffstat (limited to 'binary.sh')
| -rwxr-xr-x | binary.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/binary.sh b/binary.sh new file mode 100755 index 0000000..fbeeeae --- /dev/null +++ b/binary.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# Requirements: +# git +# UglifyJS2 (https://github.com/mishoo/UglifyJS2) + +git clone https://github.com/Gubolin/snap.git +cd "snap" +git checkout mobileapp + +rm -rf .git/ +rm lang* ypr.js paint.js cloud.js gui.js + +find . -name '*.js' | xargs -I {} uglifyjs {} -o {} -c + +sed -i '/paint\.js"/d' snap.html +sed -i '/cloud\.js"/d' snap.html +sed -i 's/gui\.js"/binary\.js"/' snap.html + +find . \( \! -name '*.js' \! -name 'snap.html' \! -name 'mobile.sh' \! -name 'desktop.sh' \! -name 'snap_logo_sm.png' \! -name 'config.xml' \! -name 'package.json' -type f \) -print0 | xargs -0 rm +find . -type d -empty -print0 | xargs -0 rm -r |
