Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

更新镜像地址和修复脚本执行边界bug #190

Merged
merged 2 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ Chrome 安装方法(Google 被墙了上不去):
# 克隆源代码
git clone -b master https://gitee.com/mirrors/replacegooglecdn.git --depth=1 --progress
# 或者
git clone -b master https://gitcode.net/mirrors/justjavac/replacegooglecdn.git --depth=1 --progress
git clone -b master https://gitcode.com/mirrors/justjavac/replacegooglecdn.git --depth=1 --progress

# 更新源代码

Expand Down
17 changes: 9 additions & 8 deletions tools/chromium.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,22 @@ CHROMIUM=''

case $OS in
"Linux")
UUID=$(cat /proc/sys/kernel/random/uuid)
CHROMIUM='chrome-linux/chrome'
UUID=$(cat /proc/sys/kernel/random/uuid)
CHROMIUM='chrome-linux/chrome'
;;
"Darwin")
UUID=$(uuidgen)
CHROMIUM='chrome-mac/Chromium.app/Contents/MacOS/Chromium'
UUID=$(uuidgen)
CHROMIUM='chrome-mac/Chromium.app/Contents/MacOS/Chromium'
;;
"MINGW64_NT")
# set chrome_user_data_dir='C:\Users\%username%\Local" "Settings\Temp\chrome-user-data'
# IF NOT EXIST %chrome_user_data_dir% MD %chrome_user_data_dir%
CHROMIUM='chrome-win\\chrome.exe'
# set chrome_user_data_dir='C:\Users\%username%\Local" "Settings\Temp\chrome-user-data'
# IF NOT EXIST %chrome_user_data_dir% MD %chrome_user_data_dir%
CHROMIUM='chrome-win\\chrome.exe'
;;
*)
echo 'current script no support !'
;;
exit 0
;;
esac

test -d /tmp/${UUID} || mkdir -p /tmp/${UUID}
Expand Down
1 change: 0 additions & 1 deletion tools/download-chromium-extension.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ while [ $# -gt 0 ]; do
export HTTPS_PROXY="$2"
export NO_PROXY="127.0.0.1,localhost,127.0.0.0/8,10.0.0.0/8,100.64.0.0/10,172.16.0.0/12,192.168.0.0/16,198.18.0.0/15,169.254.0.0/16"
export NO_PROXY="${NO_PROXY},localhost,.npmmirror.com,.aliyuncs.com,.taobao.org,.tsinghua.edu.cn,.ustc.edu.cn,.aliyun.com"
shift
;;
*) ;;

Expand Down
45 changes: 22 additions & 23 deletions tools/download-chromium.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,44 +25,42 @@ DOWNLOAD_CHROMIUM_URL=''
while [ $# -gt 0 ]; do
case "$1" in
--proxy)
export HTTP_PROXY="$2"
export HTTPS_PROXY="$2"
export NO_PROXY="127.0.0.1,localhost,127.0.0.0/8,10.0.0.0/8,100.64.0.0/10,172.16.0.0/12,192.168.0.0/16,198.18.0.0/15,169.254.0.0/16"
export NO_PROXY="${NO_PROXY},localhost,.npmmirror.com,.aliyuncs.com,.taobao.org,.tsinghua.edu.cn,.ustc.edu.cn,.aliyun.com"
shift
export HTTP_PROXY="$2"
export HTTPS_PROXY="$2"
export NO_PROXY="127.0.0.1,localhost,127.0.0.0/8,10.0.0.0/8,100.64.0.0/10,172.16.0.0/12,192.168.0.0/16,198.18.0.0/15,169.254.0.0/16"
export NO_PROXY="${NO_PROXY},localhost,.npmmirror.com,.aliyuncs.com,.taobao.org,.tsinghua.edu.cn,.ustc.edu.cn,.aliyun.com"
;;
--official)
# Download Chromium
## https://www.chromium.org/getting-involved/download-chromium/#downloading-old-builds-of-chrome-chromium
## https://commondatastorage.googleapis.com/chromium-browser-snapshots/
# Download Chromium
## https://www.chromium.org/getting-involved/download-chromium/#downloading-old-builds-of-chrome-chromium
## https://commondatastorage.googleapis.com/chromium-browser-snapshots/

## LAST_CHANGE xml format
LASTCHANGE_URL=https://commondatastorage.googleapis.com/chromium-browser-snapshots/
## LAST_CHANGE xml format
LASTCHANGE_URL=https://commondatastorage.googleapis.com/chromium-browser-snapshots/

case $OS in
"Linux")
LASTCHANGE_URL="https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/Linux_x64%2FLAST_CHANGE?alt=media"
REVISION=$(curl -s -S $LASTCHANGE_URL)
echo "latest revision is $REVISION"
DOWNLOAD_CHROMIUM_URL="https://commondatastorage.googleapis.com/chromium-browser-snapshots/Linux_x64/$REVISION/chrome-linux.zip"
LASTCHANGE_URL="https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/Linux_x64%2FLAST_CHANGE?alt=media"
REVISION=$(curl -s -S $LASTCHANGE_URL)
echo "latest revision is $REVISION"
DOWNLOAD_CHROMIUM_URL="https://commondatastorage.googleapis.com/chromium-browser-snapshots/Linux_x64/$REVISION/chrome-linux.zip"
;;
"Darwin")
LASTCHANGE_URL="https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/Mac%2FLAST_CHANGE?alt=media"
REVISION=$(curl -s -S $LASTCHANGE_URL)
echo "latest revision is $REVISION"
DOWNLOAD_CHROMIUM_URL="https://commondatastorage.googleapis.com/chromium-browser-snapshots/Mac/$REVISION/chrome-mac.zip"
LASTCHANGE_URL="https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/Mac%2FLAST_CHANGE?alt=media"
REVISION=$(curl -s -S $LASTCHANGE_URL)
echo "latest revision is $REVISION"
DOWNLOAD_CHROMIUM_URL="https://commondatastorage.googleapis.com/chromium-browser-snapshots/Mac/$REVISION/chrome-mac.zip"
;;
'MINGW64_NT'* | 'MSYS_NT'*)
LASTCHANGE_URL="https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/Win_x64%2FLAST_CHANGE?alt=media"
REVISION=$(curl -s -S $LASTCHANGE_URL)
echo "latest revision is $REVISION"
DOWNLOAD_CHROMIUM_URL="https://commondatastorage.googleapis.com/chromium-browser-snapshots/Win_x64/$REVISION/chrome-win.zip"
LASTCHANGE_URL="https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/Win_x64%2FLAST_CHANGE?alt=media"
REVISION=$(curl -s -S $LASTCHANGE_URL)
echo "latest revision is $REVISION"
DOWNLOAD_CHROMIUM_URL="https://commondatastorage.googleapis.com/chromium-browser-snapshots/Win_x64/$REVISION/chrome-win.zip"
;;
esac
;;
*)
;;

esac
shift $(($# > 0 ? 1 : 0))
done
Expand Down Expand Up @@ -112,6 +110,7 @@ case $OS in
;;
*)
echo 'no match OS'
exit 0
;;

esac
1 change: 1 addition & 0 deletions tools/firefox-web-ext.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ UUID=''
;;
*)
echo 'current script no support !'
exit 0
;;
esac

Expand Down
37 changes: 19 additions & 18 deletions tools/firefox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,25 @@ echo "$OS"

FIREFOX=''
UUID=''
case $OS in
"Linux")
UUID=$(cat /proc/sys/kernel/random/uuid)
FIREFOX=${__PROJECT__}/var/firefox/firefox
;;
"Darwin")
UUID=$(uuidgen)
# macos firefox 默认启动目录
FIREFOX='/Applications/Firefox.app/Contents/MacOS/firefox'
# 自定义 启动目录
FIREFOX="${__PROJECT__}/var/Firefox/Firefox.app/Contents/MacOS/firefox-bin"
;;
'MINGW64_NT'* | 'MSYS_NT'*)
;;
*)
echo 'current script no support !'
;;
esac
case $OS in
"Linux")
UUID=$(cat /proc/sys/kernel/random/uuid)
FIREFOX=${__PROJECT__}/var/firefox/firefox
;;
"Darwin")
UUID=$(uuidgen)
# macos firefox 默认启动目录
FIREFOX='/Applications/Firefox.app/Contents/MacOS/firefox'
# 自定义 启动目录
FIREFOX="${__PROJECT__}/var/Firefox/Firefox.app/Contents/MacOS/firefox-bin"
;;
'MINGW64_NT'* | 'MSYS_NT'*)
;;
*)
echo 'current script no support !'
exit 0
;;
esac


profile_folder="/tmp/${UUID}"
Expand Down