]> git.mxchange.org Git - friendica.git/blob - util/minifyjs.sh
The worker is now working
[friendica.git] / util / minifyjs.sh
1 #!/bin/bash
2
3 command -v uglifyjs >/dev/null 2>&1 || { echo >&2 "I require UglifyJS but it's not installed.  Aborting."; exit 1; }
4
5 MINIFY_CMD=uglifyjs
6
7 JSFILES=(
8         "js/acl.js"
9         "js/ajaxupload.js"
10         "js/country.js"
11         "js/fk.autocomplete.js"
12         "js/jquery.htmlstream.js"
13         "js/main.js"
14         "js/webtoolkit.base64.js"
15         "view/theme/frost/js/acl.js"
16         "view/theme/frost/js/jquery.divgrow-1.3.1.f1.js"
17         "view/theme/frost/js/main.js"
18         "view/theme/frost/js/theme.js"
19         "view/theme/frost-mobile/js/acl.js"
20         "view/theme/frost-mobile/js/jquery.divgrow-1.3.1.f1.js"
21         "view/theme/frost-mobile/js/main.js"
22         "view/theme/frost-mobile/js/theme.js"
23         "view/theme/decaf-mobile/js/theme.js"
24 )
25 JSFILES2=(
26         "library/colorbox/jquery.colorbox.js"
27 )
28 JSFILES3=(
29         "library/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js"
30 )
31
32 for i in ${JSFILES[@]}
33 do
34         MINFILE=${i%%.js}.min.js
35         echo "Minifying $i into $MINFILE"
36         rm $MINFILE
37         $MINIFY_CMD -o $MINFILE $i
38 done
39
40 for i in ${JSFILES2[@]}
41 do
42         MINFILE=${i%%.js}-min.js
43         echo "Minifying $i into $MINFILE"
44         rm $MINFILE
45         $MINIFY_CMD -o $MINFILE $i
46 done
47
48 for i in ${JSFILES3[@]}
49 do
50         MINFILE=${i%%_src.js}.js
51         echo "Minifying $i into $MINFILE"
52         rm $MINFILE
53         $MINIFY_CMD -o $MINFILE $i
54 done
55