File tree 3 files changed +116
-0
lines changed
3 files changed +116
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ set -e
4
+ cd " $( dirname " $0 " ) /.."
5
+
6
+ if [ " $( uname -s) " != Darwin ]; then
7
+ echo " This script only runs on macOS since it needs 'iconutil'"
8
+ exit 1
9
+ fi
10
+
11
+ if ! command -v inkscape & > /dev/null; then
12
+ echo " Please make sure to have 'inkscape' on your PATH!"
13
+ exit 1
14
+ fi
15
+
16
+ input_svg=" build/icon-macos.svg"
17
+ tmp_dir=" $( mktemp -dt zulip-icon) "
18
+ output_dir=" $tmp_dir .iconset"
19
+ output_icns=" build/icon.icns"
20
+
21
+ mv " $tmp_dir " " $output_dir "
22
+
23
+ trap " rm -rf '$output_dir '" EXIT
24
+
25
+ echo " ==> Generating icons from $input_svg ..."
26
+
27
+ for size in 16 32 64 128 256 512 1024; do
28
+ echo " Generating icon of size $size ..."
29
+ icon_prefix=" icon_${size} x${size} "
30
+ inkscape -o " $output_dir /$icon_prefix .png" -w $size " $input_svg "
31
+ inkscape -o " $output_dir /$icon_prefix @2x.png" -w $(( size * 2 )) " $input_svg "
32
+ done
33
+
34
+ echo " ==> Updating ICNS icons..."
35
+
36
+ for icns in " ${output_icns[@]} " ; do
37
+ echo " Updating $icns ..."
38
+ iconutil -c icns -o " $icns " " $output_dir "
39
+ done
You can’t perform that action at this time.
0 commit comments