代码拉取完成,页面将自动刷新
#!/bin/bash
set -exu
__DIR__=$(
cd "$(dirname "$0")"
pwd
)
cd ${__DIR__}
mkdir -p ${__DIR__}/var/
mkdir -p ${__DIR__}/dist/
## 打包 chromium 扩展
test -f ${__DIR__}/dist/ReplaceGoogleCDN-v3-chromium.zip && rm -f ${__DIR__}/dist/ReplaceGoogleCDN-v3-chromium.zip
cd ${__DIR__}/
test -d ${__DIR__}/extension/_metadata && rm -rf ${__DIR__}/extension/_metadata
cd ${__DIR__}/extension
# 打包 manifest v3 支持chromium 内核系列
zip -r ${__DIR__}/dist/ReplaceGoogleCDN-v3-chromium.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 ${__DIR__}/dist/ReplaceGoogleCDN-v3-chromium.zip ./README.md
zip -u ${__DIR__}/dist/ReplaceGoogleCDN-v3-chromium.zip ./Privacy.md
zip -u ${__DIR__}/dist/ReplaceGoogleCDN-v3-chromium.zip ./LICENSE
## 打包 firefox 扩展
test -f ${__DIR__}/dist/ReplaceGoogleCDN-v3-firefox.zip && rm -f ${__DIR__}/dist/ReplaceGoogleCDN-v3-firefox.zip
mkdir -p ${__DIR__}/var/extension-tmp/rules/
cp -rf ${__DIR__}/extension/rules/*.json ${__DIR__}/var/extension-tmp/rules/
cp -rf ${__DIR__}/extension/icons ${__DIR__}/var/extension-tmp/
rm -f ${__DIR__}/var/extension-tmp/rules/rules_remove_content_security_policy_header_test.json
rm -f ${__DIR__}/var/extension-tmp/rules/rules-default-domains-helper.json
python3 tools/update-v3-manifest.py firefox
cd ${__DIR__}/var/extension-tmp/
zip -r ${__DIR__}/dist/ReplaceGoogleCDN-v3-firefox.zip .
cd ${__DIR__}/
zip -u ${__DIR__}/dist/ReplaceGoogleCDN-v3-firefox.zip ./README.md
zip -u ${__DIR__}/dist/ReplaceGoogleCDN-v3-firefox.zip ./Privacy.md
zip -u ${__DIR__}/dist/ReplaceGoogleCDN-v3-firefox.zip ./LICENSE
# 查看打包结果
cd ${__DIR__}/dist
test -d ReplaceGoogleCDN-v3-chromium && rm -rf ReplaceGoogleCDN-v3-chromium
test -d ReplaceGoogleCDN-v3-firefox && rm -rf ReplaceGoogleCDN-v3-firefox
unzip ReplaceGoogleCDN-v3-chromium.zip -d ReplaceGoogleCDN-v3-chromium
unzip ReplaceGoogleCDN-v3-firefox.zip -d ReplaceGoogleCDN-v3-firefox
cd ${__DIR__}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。