-
Notifications
You must be signed in to change notification settings - Fork 0
/
make.sh
executable file
·79 lines (77 loc) · 2.24 KB
/
make.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
mkdir -p _dist _pkg .tmp
case $1 in
gc)
find _dist/wwwmisc/patterns -name '.goutputstream*' -delete
;;
sh)
mkdir -p wwwmisc _dist/wwwmisc
chmod +x sh/*.sh
export MASSIVE_MODE=y
for i in sh/*.sh; do
bash "$i"
done
;;
zip)
bash "$0" gc
rm _pkg/Nekostein-VI.zip
zip -9vr _pkg/Nekostein-VI _dist/wwwmisc -x "_dist/wwwmisc/patterns/*.js.png"
du -h _pkg/*
;;
up|upload)
cfoss2 _pkg/Nekostein-VI.zip
# minoss _pkg/Nekostein-VI.zip
;;
install|ins)
ln -svf "$PWD/misc/nekostein-installvilib.sh" "$HOME/.local/bin/nekostein-installvilib.sh"
;;
rel|release)
tagid="snapshot-$(TZ=UTC date +%Y%m%d)"
echo '$' git tag "$tagid" ';' git push origin "$tagid"
echo "url: https://github.com/nekostein/nekostein-vi/releases/new"
echo "zip: $(realpath _pkg/Nekostein-VI.zip)"
;;
local)
bash sh/000-prepare.sh
nekostein-installvilib.sh --local
;;
fast)
bash sh/000-prepare.sh
bash "$0" zip
bash "$0" upload
nekostein-installvilib.sh --local
;;
send)
### Send dist to a local directory
if [[ -e "$2/_dist/libvi/geologo/Nekostein-geologo.white_null.png" ]]; then
rsync -av _dist/wwwmisc/ "$(realpath "$2/_dist/libvi")/"
fi
;;
fonts)
exit 0
# cfoss2 ~/.fonts/inter-tight/InterTight-Medium.ttf
;;
patterns/js/*.js)
svgpath="$(sed 's|js|svg|g' <<< "$1")"
node "$1" > "$svgpath"
realpath "$svgpath"
extra_output_prefix="_dist/wwwmisc/patterns/$(basename "$1" | cut -d- -f1)"
dirname "$extra_output_prefix" | xargs mkdir -p
case $2 in
png|pdf)
rsvg-convert "$svgpath" -f "$2" -z1 -o "$extra_output_prefix.$2"
realpath "$extra_output_prefix.$2" | xargs du -h
;;
esac
rsync -av patterns/svg/ _dist/wwwmisc/patterns/
;;
'')
bash "$0" zip
bash "$0" upload
bash "$0" release
nekostein-installvilib.sh
;;
*)
echo "[ERROR] Invalid target"
;;
esac