forked from justjavac/ReplaceGoogleCDN
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease-archive.sh
75 lines (58 loc) · 1.69 KB
/
release-archive.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
#!/bin/bash
set -exu
__DIR__=$(
cd "$(dirname "$0")"
pwd
)
cd ${__DIR__}
test -d extension/_metadata/ && rm -rf extension/_metadata/
mkdir -p dist/
cd ${__DIR__}/dist
test -f ReplaceGoogleCDN-v2.zip && rm -f ReplaceGoogleCDN-v2.zip
test -f ReplaceGoogleCDN-v3.zip && rm -f ReplaceGoogleCDN-v3.zip
cd ${__DIR__}/extension
# 打包 manifest v3 支持chromium 内核系列
zip -r ../dist/ReplaceGoogleCDN-v3.zip . \
-x ".git/*" \
-x ".idea/*" \
-x "_metadata/*" \
-x "node_modules/*" \
-x "tools/*" \
-x "_metadata/*" \
-x "rules/example-advance/*" \
-x "rules/example/*" \
-x "background-page.html" \
-x "screenshot/*" \
-x "test/*" \
-x "web/*" \
-x "web-backup/*" \
-x "manifest-backup.json" \
-x "third_party/highlightjs/*" \
-x "third_party/webrtc/*"
cd ${__DIR__}
zip -u dist/ReplaceGoogleCDN-v3.zip ./README.md
zip -u dist/ReplaceGoogleCDN-v3.zip ./Privacy.md
zip -u dist/ReplaceGoogleCDN-v3.zip ./LICENSE
# 打包 manifest v2 支持chromium 内核系列 和 firefox
cd ${__DIR__}/extension-v2/
zip -r ../dist/ReplaceGoogleCDN-v2.zip . \
-x ".git/*" \
-x ".idea/*" \
-x "_metadata/*" \
-x "node_modules/*" \
-x "tools/*" \
-x "js/background-advance.js" \
-x "js/background-default.js" \
-x "./README.md" \
-x "./test/*"
cd ${__DIR__}
zip -u dist/ReplaceGoogleCDN-v2.zip ./README.md
zip -u dist/ReplaceGoogleCDN-v2.zip ./Privacy.md
zip -u dist/ReplaceGoogleCDN-v2.zip ./LICENSE
cd ${__DIR__}/dist
# 查看打包结果
test -d ReplaceGoogleCDN-v2 && rm -rf ReplaceGoogleCDN-v2
test -d ReplaceGoogleCDN-v3 && rm -rf ReplaceGoogleCDN-v3
unzip ReplaceGoogleCDN-v2.zip -d ReplaceGoogleCDN-v2
unzip ReplaceGoogleCDN-v3.zip -d ReplaceGoogleCDN-v3
cd ${__DIR__}