-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcombine.sh
100 lines (80 loc) · 3.8 KB
/
combine.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
echo ''
echo '-------------------------------------'
echo 'Formatting XML Files ......'
echo '-------------------------------------'
echo ''
cd ./tmp
xmllint --format stable-x86.unformat.xml > stable-x86.format.xml
xmllint --format stable-x64.unformat.xml > stable-x64.format.xml
xmllint --format beta-x86.unformat.xml > beta-x86.format.xml
xmllint --format beta-x64.unformat.xml > beta-x64.format.xml
xmllint --format dev-x86.unformat.xml > dev-x86.format.xml
xmllint --format dev-x64.unformat.xml > dev-x64.format.xml
xmllint --format canary-x86.unformat.xml > canary-x86.format.xml
xmllint --format canary-x64.unformat.xml > canary-x64.format.xml
echo ''
echo '-------------------------------------'
echo 'Combining XML Files ......'
echo '-------------------------------------'
echo ''
echo '<?xml version="1.0" encoding="UTF-8"?>' > chrome.tmp.xml
echo '<chromechecker>' >> chrome.tmp.xml
DATE="$(echo $(date --rfc-2822))"
echo '<time checktime="'$DATE'"/>' >> chrome.tmp.xml
echo '<stable86>' >> chrome.tmp.xml
cat stable-x86.format.xml | grep '<manifest version' >> chrome.tmp.xml
cat stable-x86.format.xml | grep '<url codebase="https://dl.google.com/' >> chrome.tmp.xml
cat stable-x86.format.xml | grep '<package fp' >> chrome.tmp.xml
echo '</stable86>' >> chrome.tmp.xml
echo '<stable64>' >> chrome.tmp.xml
cat stable-x64.format.xml | grep '<manifest version' >> chrome.tmp.xml
cat stable-x64.format.xml | grep '<url codebase="https://dl.google.com/' >> chrome.tmp.xml
cat stable-x64.format.xml | grep '<package fp' >> chrome.tmp.xml
echo '</stable64>' >> chrome.tmp.xml
echo '<beta86>' >> chrome.tmp.xml
cat beta-x86.format.xml | grep '<manifest version' >> chrome.tmp.xml
cat beta-x86.format.xml | grep '<url codebase="https://dl.google.com/' >> chrome.tmp.xml
cat beta-x86.format.xml | grep '<package fp' >> chrome.tmp.xml
echo '</beta86>' >> chrome.tmp.xml
echo '<beta64>' >> chrome.tmp.xml
cat beta-x64.format.xml | grep '<manifest version' >> chrome.tmp.xml
cat beta-x64.format.xml | grep '<url codebase="https://dl.google.com/' >> chrome.tmp.xml
cat beta-x64.format.xml | grep '<package fp' >> chrome.tmp.xml
echo '</beta64>' >> chrome.tmp.xml
echo '<dev86>' >> chrome.tmp.xml
cat dev-x86.format.xml | grep '<manifest version' >> chrome.tmp.xml
cat dev-x86.format.xml | grep '<url codebase="https://dl.google.com/' >> chrome.tmp.xml
cat dev-x86.format.xml | grep '<package fp' >> chrome.tmp.xml
echo '</dev86>' >> chrome.tmp.xml
echo '<dev64>' >> chrome.tmp.xml
cat dev-x64.format.xml | grep '<manifest version' >> chrome.tmp.xml
cat dev-x64.format.xml | grep '<url codebase="https://dl.google.com/' >> chrome.tmp.xml
cat dev-x64.format.xml | grep '<package fp' >> chrome.tmp.xml
echo '</dev64>' >> chrome.tmp.xml
echo '<canary86>' >> chrome.tmp.xml
cat canary-x86.format.xml | grep '<manifest version' >> chrome.tmp.xml
cat canary-x86.format.xml | grep '<url codebase="https://dl.google.com/' >> chrome.tmp.xml
cat canary-x86.format.xml | grep '<package fp' >> chrome.tmp.xml
echo '</canary86>' >> chrome.tmp.xml
echo '<canary64>' >> chrome.tmp.xml
cat canary-x64.format.xml | grep '<manifest version' >> chrome.tmp.xml
cat canary-x64.format.xml | grep '<url codebase="https://dl.google.com/' >> chrome.tmp.xml
cat canary-x64.format.xml | grep '<package fp' >> chrome.tmp.xml
echo '</canary64>' >> chrome.tmp.xml
echo '</chromechecker>' >> chrome.tmp.xml
echo ''
echo '-------------------------------------'
echo 'Formatting Output ......'
echo '-------------------------------------'
echo ''
sed -i 's|">|"/>|g' chrome.tmp.xml
xmllint --format chrome.tmp.xml > chrome.xml
echo ''
echo '-------------------------------------'
echo 'Compressing Output ......'
echo '-------------------------------------'
echo ''
xmllint --noblanks chrome.xml > chrome.min.xml
cp -rf ./chrome.xml ../public/chrome.xml
cp -rf ./chrome.min.xml ../public/chrome.min.xml
cd ..