forked from shimmerproject/libreoffice-style-elementary
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sh
56 lines (48 loc) · 1.09 KB
/
build.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
#!/bin/bash
#2020 by Rizal Muttaqin
if ! command -v optipng >/dev/null
then
echo "Please install optipng"
exit 1
fi
if ! command -v svgcleaner >/dev/null
then
echo "Please install svgcleaner"
exit 1
fi
echo "=> Remove old PNG version"
cp "elementary/links.txt" \
"elementary_svg"
rm -Rf "elementary"
cd "elementary_svg"
echo "=> Clean SVG files ..."
find -name "*.svg" -o -name "*.SVG" | while read i;
do
echo "This $i file is compressed"
fname=$( basename "$i")
# echo "has the name: $fname"
fdir=$( dirname "$i")
# echo "and is in the directory: ${fdir##*/}"
svgcleaner "$i" "${i%.*}.svg"
done
cd "./.."
cp -Rf "elementary_svg" \
"elementary"
rm "elementary_svg/links.txt"
cd "elementary"
echo "=> Export SVG to PNG ..."
find -name "*.svg" -o -name "*.SVG" | while read i;
do
echo "This $i file is compressed"
fname=$( basename "$i")
fdir=$( dirname "$i")
inkscape -p "$i" -o "${i%.*}.png"
optipng -o7 "${i%.*}.png"
done
echo "=> Delete SVG files ..."
find -name "*.svg" -o -name "*.SVG" | while read i;
do
fname=$( basename "$i")
fdir=$( dirname "$i")
rm "$i"
done