fix: optimize repo clone in run.sh

This commit is contained in:
zhayujie
2026-03-28 15:08:57 +08:00
parent 48729678cf
commit 1e8959fbcf
3 changed files with 7 additions and 3 deletions

1
.gitignore vendored
View File

@@ -37,6 +37,7 @@ client_config.json
ref/
.cursor/
local/
node_modules/
# cow cli
dist/

View File

@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools>=68.0"]
requires = ["setuptools>=45.0"]
build-backend = "setuptools.build_meta"
[project]

7
run.sh
View File

@@ -171,8 +171,11 @@ clone_project() {
mv chatgpt-on-wechat-master chatgpt-on-wechat
rm chatgpt-on-wechat.zip
else
git clone https://github.com/zhayujie/chatgpt-on-wechat.git || \
git clone https://gitee.com/zhayujie/chatgpt-on-wechat.git
GIT_HTTP_CONNECT_TIMEOUT=10 GIT_HTTP_LOW_SPEED_LIMIT=1024 GIT_HTTP_LOW_SPEED_TIME=15 \
git clone --depth 10 --progress https://github.com/zhayujie/chatgpt-on-wechat.git || {
echo -e "${YELLOW}⚠️ GitHub is slow, switching to Gitee mirror...${NC}"
git clone --depth 10 --progress https://gitee.com/zhayujie/chatgpt-on-wechat.git
}
if [[ $? -ne 0 ]]; then
echo -e "${RED}❌ Project clone failed. Please check network connection.${NC}"
exit 1