-
Notifications
You must be signed in to change notification settings - Fork 95
/
1-update-material-design.sh
executable file
·168 lines (162 loc) · 7.06 KB
/
1-update-material-design.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
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
#!/bin/bash
set -e
# Preparations are:
# sudo apt-get install npm gulp
# sudo npm install -g npm
# sudo npm -g install svgo
# npm install
DIRECTORIES='material-design material-design-outlined material-design-round material-design-sharp material-design-twotone'
rm -rf $DIRECTORIES
if [ -e material-design-icons ]; then
cd material-design-icons
git pull -r
else
git clone https://github.com/google/material-design-icons.git
cd material-design-icons
fi
cd src
for CATEGORY in *; do
echo $CATEGORY
cd $CATEGORY
for ICON in *; do
echo \ \ $ICON
cd $ICON
for STYLE in *; do
if [ $STYLE = materialicons ]; then
cd $STYLE
mkdir -p ../../../../../material-design/material-design-$CATEGORY
if [ -e 36px.svg ]; then # resolution
cp 36px.svg ../../../../../material-design/material-design-$CATEGORY/$ICON.svg
else
if [ -e 24px.svg ]; then
cp 24px.svg ../../../../../material-design/material-design-$CATEGORY/$ICON.svg
else
if [ -e 20px.svg ]; then
cp 20px.svg ../../../../../material-design/material-design-$CATEGORY/$ICON.svg
else
if [ -e 18px.svg ]; then
cp 18px.svg ../../../../../material-design/material-design-$CATEGORY/$ICON.svg
else
echo ERROR: Unsupported resolution
pwd
ls
exit 1
fi
fi
fi
fi
cd ..
fi
if [ $STYLE = materialiconsoutlined ]; then
cd $STYLE
mkdir -p ../../../../../material-design-outlined/material-design-outlined-$CATEGORY
if [ -e 36px.svg ]; then # resolution
cp 36px.svg ../../../../../material-design-outlined/material-design-outlined-$CATEGORY/$ICON.svg
else
if [ -e 24px.svg ]; then
cp 24px.svg ../../../../../material-design-outlined/material-design-outlined-$CATEGORY/$ICON.svg
else
if [ -e 20px.svg ]; then
cp 20px.svg ../../../../../material-design-outlined/material-design-outlined-$CATEGORY/$ICON.svg
else
if [ -e 18px.svg ]; then
cp 18px.svg ../../../../../material-design-outlined/material-design-outlined-$CATEGORY/$ICON.svg
else
echo ERROR: Unsupported resolution
pwd
ls
exit 1
fi
fi
fi
fi
cd ..
fi
if [ $STYLE = materialiconsround ]; then
cd $STYLE
mkdir -p ../../../../../material-design-round/material-design-round-$CATEGORY
if [ -e 36px.svg ]; then # resolution
cp 36px.svg ../../../../../material-design-round/material-design-round-$CATEGORY/$ICON.svg
else
if [ -e 24px.svg ]; then
cp 24px.svg ../../../../../material-design-round/material-design-round-$CATEGORY/$ICON.svg
else
if [ -e 20px.svg ]; then
cp 20px.svg ../../../../../material-design-round/material-design-round-$CATEGORY/$ICON.svg
else
if [ -e 18px.svg ]; then
cp 18px.svg ../../../../../material-design-round/material-design-round-$CATEGORY/$ICON.svg
else
echo ERROR: Unsupported resolution
pwd
ls
exit 1
fi
fi
fi
fi
cd ..
fi
if [ $STYLE = materialiconssharp ]; then
cd $STYLE
mkdir -p ../../../../../material-design-sharp/material-design-sharp-$CATEGORY
if [ -e 36px.svg ]; then # resolution
cp 36px.svg ../../../../../material-design-sharp/material-design-sharp-$CATEGORY/$ICON.svg
else
if [ -e 24px.svg ]; then
cp 24px.svg ../../../../../material-design-sharp/material-design-sharp-$CATEGORY/$ICON.svg
else
if [ -e 20px.svg ]; then
cp 20px.svg ../../../../../material-design-sharp/material-design-sharp-$CATEGORY/$ICON.svg
else
if [ -e 18px.svg ]; then
cp 18px.svg ../../../../../material-design-sharp/material-design-sharp-$CATEGORY/$ICON.svg
else
echo ERROR: Unsupported resolution
pwd
ls
exit 1
fi
fi
fi
fi
cd ..
fi
if [ $STYLE = materialiconstwotone ]; then
cd $STYLE
mkdir -p ../../../../../material-design-twotone/material-design-twotone-$CATEGORY
if [ -e 36px.svg ]; then # resolution
cp 36px.svg ../../../../../material-design-twotone/material-design-twotone-$CATEGORY/$ICON.svg
else
if [ -e 24px.svg ]; then
cp 24px.svg ../../../../../material-design-twotone/material-design-twotone-$CATEGORY/$ICON.svg
else
if [ -e 20px.svg ]; then
cp 20px.svg ../../../../../material-design-twotone/material-design-twotone-$CATEGORY/$ICON.svg
else
if [ -e 18px.svg ]; then
cp 18px.svg ../../../../../material-design-twotone/material-design-twotone-$CATEGORY/$ICON.svg
else
echo ERROR: Unsupported resolution
pwd
ls
exit 1
fi
fi
fi
fi
cd ..
fi
done # STYLE
cd ..
done # ICON
cd ..
done # CATEGORY
cd ../.. # material-design-icons/src
for DIRECTORY in $DIRECTORIES; do
svgo -q -r -i $DIRECTORY
for i in $DIRECTORY/*; do
gulp --max-old-space-size=4096 --iconset $i --dest .
done
done
#TODO