修复首次拉区repo cdn无效

This commit is contained in:
hanhh 2021-08-05 01:07:47 +08:00
parent 603dc07581
commit d6f5198893

View File

@ -152,11 +152,12 @@ update_repo() {
local repo_path="${dir_repo}/${author}_${repo}"
[[ $branch ]] && repo_path="${repo_path}_${branch}"
local formatUrl="${github_proxy_url}${url/https:\/\/ghproxy.com\//}"
if [ -d ${repo_path}/.git ]; then
reset_romote_url ${repo_path} "${github_proxy_url}${url/https:\/\/ghproxy.com\//}" "${branch}"
reset_romote_url ${repo_path} "${formatUrl}" "${branch}"
git_pull_scripts ${repo_path} "${branch}"
else
git_clone_scripts ${url} ${repo_path} "${branch}"
git_clone_scripts "${formatUrl}" ${repo_path} "${branch}"
fi
if [[ $exit_status -eq 0 ]]; then
echo -e "\n更新${repo_path}成功...\n"