forked from f-droid/repomaker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pre-release.sh
executable file
·60 lines (45 loc) · 1.71 KB
/
pre-release.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/env bash
set -e
shopt -s extglob
NODE=node_modules
set -x
# compile translations
python3 manage.py compilemessages
# update npm packages
npm install
# dialog-polyfill remove unused files
rm -rf ${NODE}/dialog-polyfill/!(dialog-polyfill.*)
# material-design-icons-iconfont remove unused files
rm -rf ${NODE}/material-design-icons-iconfont/!(src|dist)
rm -rf ${NODE}/material-design-icons-iconfont/dist/!(fonts)
rm -rf ${NODE}/material-design-icons-iconfont/src/!(material-design-icons.scss)
rm -rf ${NODE}/material-design-icons-iconfont/.idea
# material-design-lite remove unused files
rm -rf ${NODE}/material-design-lite/!(dist|src|material*.js)
rm -rf ${NODE}/material-design-lite/dist/!(images)
rm -rf ${NODE}/material-design-lite/.[tj]*
# roboto-fontface remove unused files
rm -rf ${NODE}/roboto-fontface/!(css|fonts)
rm -rf ${NODE}/roboto-fontface/.npmignore
# tinymce remove unused files
rm -rf ${NODE}/tinymce/!(plugins|skins|themes|tinymce*.js)
rm -rf ${NODE}/tinymce/themes/!(modern)
rm -rf ${NODE}/tinymce/plugins/!(autolink|link|lists)
# compile stylesheets
python3 manage.py compilescss
# rename folders so they can be ignored
mv ${NODE}/material-design-lite/src ${NODE}/material-design-lite/src-ignore
mv ${NODE}/roboto-fontface/css ${NODE}/roboto-fontface/css-ignore
# copy static files into STATIC_DIR
python3 manage.py collectstatic --no-input \
-i *.scss -i *.less \
-i tiny_mce \
-i src-ignore \
-i css-ignore \
--clear
# rename folders back
mv ${NODE}/material-design-lite/src-ignore ${NODE}/material-design-lite/src
mv ${NODE}/roboto-fontface/css-ignore ${NODE}/roboto-fontface/css
# compress stylesheets and javascripts
python3 manage.py compress --force
echo "Ready to ship release!"