From 1e8959fbcf1fbe7520731e83dc1efce0fd648766 Mon Sep 17 00:00:00 2001 From: zhayujie Date: Sat, 28 Mar 2026 15:08:57 +0800 Subject: [PATCH] fix: optimize repo clone in run.sh --- .gitignore | 1 + pyproject.toml | 2 +- run.sh | 7 +++++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 2c5a8509..1aee851f 100644 --- a/.gitignore +++ b/.gitignore @@ -37,6 +37,7 @@ client_config.json ref/ .cursor/ local/ +node_modules/ # cow cli dist/ diff --git a/pyproject.toml b/pyproject.toml index db8aa04d..565d07e2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=68.0"] +requires = ["setuptools>=45.0"] build-backend = "setuptools.build_meta" [project] diff --git a/run.sh b/run.sh index 42a3b5bb..7fa00c73 100755 --- a/run.sh +++ b/run.sh @@ -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