-
Notifications
You must be signed in to change notification settings - Fork 352
/
refresh-icon
executable file
·208 lines (161 loc) · 8.13 KB
/
refresh-icon
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
#!/bin/sh
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
cd "${DIR}"
generate_iconset(){
local full_icon="$1"
local type=`file -b ${full_icon}`
if [[ $type =~ JPEG ]]
then
cp "$full_icon" Icon-20.jpg &> /dev/null
sips -z 29 29 Icon-20.jpg &> /dev/null
sips -s format png Icon-20.jpg --out Icon-20.png &> /dev/null
cp "$full_icon" Icon-Small.jpg &> /dev/null
sips -z 29 29 Icon-Small.jpg &> /dev/null
sips -s format png Icon-Small.jpg --out Icon-Small.png &> /dev/null
cp "$full_icon" [email protected] &> /dev/null
sips -z 58 58 [email protected] &> /dev/null
sips -s format png [email protected] --out [email protected] &> /dev/null
cp "$full_icon" [email protected] &> /dev/null
sips -z 87 87 [email protected] &> /dev/null
sips -s format png [email protected] --out [email protected] &> /dev/null
cp "$full_icon" Icon-Small-50.jpg &> /dev/null
sips -z 50 50 Icon-Small-50.jpg &> /dev/null
sips -s format png Icon-Small-50.jpg --out Icon-Small-50.png &> /dev/null
cp "$full_icon" [email protected] &> /dev/null
sips -z 100 100 [email protected] &> /dev/null
sips -s format png [email protected] --out [email protected] &> /dev/null
cp "$full_icon" Icon.jpg &> /dev/null
sips -z 57 57 Icon.jpg &> /dev/null
sips -s format png Icon.jpg --out Icon.png &> /dev/null
cp "$full_icon" [email protected] &> /dev/null
sips -z 114 114 [email protected] &> /dev/null
sips -s format png [email protected] --out [email protected] &> /dev/null
cp "$full_icon" [email protected] &> /dev/null
sips -z 40 40 [email protected] &> /dev/null
sips -s format png [email protected] --out [email protected] &> /dev/null
cp "$full_icon" Icon-40.jpg &> /dev/null
sips -z 40 40 Icon-40.jpg &> /dev/null
sips -s format png Icon-40.jpg --out Icon-40.png &> /dev/null
cp "$full_icon" [email protected] &> /dev/null
sips -z 60 60 [email protected] &> /dev/null
sips -s format png [email protected] --out [email protected] &> /dev/null
cp "$full_icon" [email protected] &> /dev/null
sips -z 80 80 [email protected] &> /dev/null
sips -s format png [email protected] --out [email protected] &> /dev/null
cp "$full_icon" [email protected] &> /dev/null
sips -z 120 120 [email protected] &> /dev/null
sips -s format png [email protected] --out [email protected] &> /dev/null
cp "$full_icon" [email protected] &> /dev/null
sips -z 120 120 [email protected] &> /dev/null
sips -s format png [email protected] --out [email protected] &> /dev/null
cp "$full_icon" [email protected] &> /dev/null
sips -z 180 180 [email protected] &> /dev/null
sips -s format png [email protected] --out [email protected] &> /dev/null
cp "$full_icon" Icon-72.jpg &> /dev/null
sips -z 72 72 Icon-72.jpg &> /dev/null
sips -s format png Icon-72.jpg --out Icon-72.png &> /dev/null
cp "$full_icon" [email protected] &> /dev/null
sips -z 144 144 [email protected] &> /dev/null
sips -s format png [email protected] --out [email protected] &> /dev/null
cp "$full_icon" Icon-76.jpg &> /dev/null
sips -z 76 76 Icon-76.jpg &> /dev/null
sips -s format png Icon-76.jpg --out Icon-76.png &> /dev/null
cp "$full_icon" [email protected] &> /dev/null
sips -z 152 152 [email protected] &> /dev/null
sips -s format png [email protected] --out [email protected] &> /dev/null
cp "$full_icon" [email protected] &> /dev/null
sips -z 167 167 [email protected] &> /dev/null
sips -s format png [email protected] --out [email protected] &> /dev/null
cp "$full_icon" [email protected] &> /dev/null
sips -z 1024 1024 [email protected] &> /dev/null
sips -s format png [email protected] --out [email protected] &> /dev/null
rm Icon-20.jpg
rm Icon-Small.jpg
rm Icon-Small-50.jpg
rm Icon.jpg
rm Icon-40.jpg
rm Icon-72.jpg
rm Icon-76.jpg
else
cp "$full_icon" Icon-20.png &> /dev/null
sips -z 20 20 Icon-20.png &> /dev/null
cp "$full_icon" Icon-Small.png &> /dev/null
sips -z 29 29 Icon-Small.png &> /dev/null
cp "$full_icon" [email protected] &> /dev/null
sips -z 40 40 [email protected] &> /dev/null
cp "$full_icon" [email protected] &> /dev/null
sips -z 58 58 [email protected] &> /dev/null
cp "$full_icon" [email protected] &> /dev/null
sips -z 60 60 [email protected] &> /dev/null
cp "$full_icon" [email protected] &> /dev/null
sips -z 87 87 [email protected] &> /dev/null
cp "$full_icon" Icon-Small-50.png &> /dev/null
sips -z 50 50 Icon-Small-50.png &> /dev/null
cp "$full_icon" [email protected] &> /dev/null
sips -z 100 100 [email protected] &> /dev/null
cp "$full_icon" Icon.png &> /dev/null
sips -z 57 57 Icon.png &> /dev/null
cp "$full_icon" [email protected] &> /dev/null
sips -z 114 114 [email protected] &> /dev/null
cp "$full_icon" Icon-40.png &> /dev/null
sips -z 40 40 Icon-40.png &> /dev/null
cp "$full_icon" [email protected] &> /dev/null
sips -z 80 80 [email protected] &> /dev/null
cp "$full_icon" [email protected] &> /dev/null
sips -z 120 120 [email protected] &> /dev/null
cp "$full_icon" [email protected] &> /dev/null
sips -z 120 120 [email protected] &> /dev/null
cp "$full_icon" [email protected] &> /dev/null
sips -z 180 180 [email protected] &> /dev/null
cp "$full_icon" Icon-72.png &> /dev/null
sips -z 72 72 Icon-72.png &> /dev/null
cp "$full_icon" [email protected] &> /dev/null
sips -z 144 144 [email protected] &> /dev/null
cp "$full_icon" Icon-76.png &> /dev/null
sips -z 76 76 Icon-76.png &> /dev/null
cp "$full_icon" [email protected] &> /dev/null
sips -z 152 152 [email protected] &> /dev/null
cp "$full_icon" [email protected] &> /dev/null
sips -z 167 167 [email protected] &> /dev/null
cp "$full_icon" [email protected] &> /dev/null
sips -z 1024 1024 [email protected] &> /dev/null
fi
mv Icon-20.png app/Jasonette/Media.xcassets/AppIcon.appiconset/Icon-20.png &> /dev/null
mv [email protected] app/Jasonette/Media.xcassets/AppIcon.appiconset/[email protected] &> /dev/null
mv [email protected] app/Jasonette/Media.xcassets/AppIcon.appiconset/[email protected] &> /dev/null
mv Icon-Small.png app/Jasonette/Media.xcassets/AppIcon.appiconset/Icon-Small.png &> /dev/null
mv [email protected] app/Jasonette/Media.xcassets/AppIcon.appiconset/[email protected] &> /dev/null
mv [email protected] app/Jasonette/Media.xcassets/AppIcon.appiconset/[email protected] &> /dev/null
mv Icon-Small-50.png app/Jasonette/Media.xcassets/AppIcon.appiconset/Icon-Small-50.png &> /dev/null
mv [email protected] app/Jasonette/Media.xcassets/AppIcon.appiconset/[email protected] &> /dev/null
mv Icon.png app/Jasonette/Media.xcassets/AppIcon.appiconset/Icon.png &> /dev/null
mv [email protected] app/Jasonette/Media.xcassets/AppIcon.appiconset/[email protected] &> /dev/null
mv Icon-40.png app/Jasonette/Media.xcassets/AppIcon.appiconset/Icon-40.png &> /dev/null
mv [email protected] app/Jasonette/Media.xcassets/AppIcon.appiconset/[email protected] &> /dev/null
mv [email protected] app/Jasonette/Media.xcassets/AppIcon.appiconset/[email protected] &> /dev/null
mv [email protected] app/Jasonette/Media.xcassets/AppIcon.appiconset/[email protected] &> /dev/null
mv [email protected] app/Jasonette/Media.xcassets/AppIcon.appiconset/[email protected] &> /dev/null
mv Icon-72.png app/Jasonette/Media.xcassets/AppIcon.appiconset/Icon-72.png &> /dev/null
mv [email protected] app/Jasonette/Media.xcassets/AppIcon.appiconset/[email protected] &> /dev/null
mv Icon-76.png app/Jasonette/Media.xcassets/AppIcon.appiconset/Icon-76.png &> /dev/null
mv [email protected] app/Jasonette/Media.xcassets/AppIcon.appiconset/[email protected] &> /dev/null
mv [email protected] app/Jasonette/Media.xcassets/AppIcon.appiconset/[email protected] &> /dev/null
mv [email protected] app/Jasonette/Media.xcassets/AppIcon.appiconset/[email protected] &> /dev/null
}
for file in icon/*.{jpg,jpeg,JPG,JPEG,png,PNG}; do
[ -e "$file" ] && generate_iconset "$file" && break
done