-
Notifications
You must be signed in to change notification settings - Fork 525
/
release-archive.sh
42 lines (32 loc) · 970 Bytes
/
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
#!/usr/bin/env bash
set -exu
__DIR__=$(
cd "$(dirname "$0")"
pwd
)
__PROJECT__=${__DIR__}
cd ${__PROJECT__}
mkdir -p ${__PROJECT__}/var/
mkdir -p ${__PROJECT__}/dist/
test -f ${__PROJECT__}/dist/ReplaceGoogleCDN-v2.zip && rm -f ${__PROJECT__}/dist/ReplaceGoogleCDN-v2.zip
# 打包 manifest v2 支持chromium 内核系列 和 firefox
cd ${__PROJECT__}/extension-v2/
zip -r ${__PROJECT__}/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 ${__PROJECT__}
zip -u dist/ReplaceGoogleCDN-v2.zip ./README.md
zip -u dist/ReplaceGoogleCDN-v2.zip ./Privacy.md
zip -u dist/ReplaceGoogleCDN-v2.zip ./LICENSE
cd ${__PROJECT__}/dist/
# 查看打包结果
test -d ReplaceGoogleCDN-v2 && rm -rf ReplaceGoogleCDN-v2
unzip ReplaceGoogleCDN-v2.zip -d ReplaceGoogleCDN-v2
cd ${__PROJECT__}