-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
icon_update.sh
executable file
·75 lines (61 loc) · 1.38 KB
/
icon_update.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
#!/usr/bin/env bash
set -exuo pipefail
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
TOPLEVEL="$(git -C "${DIR}" rev-parse --show-toplevel)"
IN_ICON="${1:-src/assets/icon.svg}"
IN_FEATURE_GRAPHIC="${2:-src/assets/feature-graphic.svg}"
IN_SPLASH="${3:-src/assets/splash.svg}"
OUT_FAVICON="src/assets/favicon.ico"
OUT_ICON="resources/icon.png"
OUT_ICON_PLAYSTORE="resources/icon-playstore.png"
OUT_SPLASH="resources/splash.png"
OUT_FEATURE_GRAPHIC="resources/feature-graphic.png"
COLOR_EXTENT="#8c8c8cff"
EXTENT_COLOR_BACKGROUND=(
-gravity center
-background "${COLOR_EXTENT}"
)
(
cd "${TOPLEVEL}"
(
# Favicon
convert \
-density 384 \
"${IN_ICON}" \
-trim \
-define icon:auto-resize \
"${OUT_FAVICON}"
) &
(
# Icon
convert \
-density 1200 \
"${IN_ICON}" \
-resize 1400x1400 \
"${OUT_ICON}"
convert \
"${OUT_ICON}" \
-resize 512x512\! \
"${OUT_ICON_PLAYSTORE}"
) &
(
# Splash
convert \
"${IN_SPLASH}" \
"${EXTENT_COLOR_BACKGROUND[@]}" \
-extent 2732x2732 \
"${OUT_SPLASH}"
) &
(
# Feature Graphic
convert \
-density 1200 \
"${IN_FEATURE_GRAPHIC}" \
-resize 1024x500 \
"${EXTENT_COLOR_BACKGROUND[@]}" \
-extent 1024x500 \
"${OUT_FEATURE_GRAPHIC}"
) &
wait
ionic cordova resources
)