Skip to content
Closed
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
9 changes: 4 additions & 5 deletions shell/core/sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,10 @@ function gen_repoconf_array() {
# echo -e "$WARN 未检测到第$(($arr_index + 1))个仓库配置的链接地址,跳过..."
continue
fi
# 判断仓库地址格式
# 判断仓库地址格式,没有 .git 后缀则自动补上
echo "${tmp_url}" | grep -Eq "\.git$" # 链接必须以.git结尾
if [ $? -ne 0 ]; then
echo -e "$WARN 检测到第$(($conf_index + 1))个仓库配置的链接地址无效,跳过..."
continue
tmp_url="${tmp_url}.git"
fi
echo "${tmp_url}" | grep -Eq "https?:"
if [ $? -ne 0 ]; then
Expand All @@ -100,10 +99,10 @@ function gen_repoconf_array() {
## 代码仓库名称(如若未定义则采用链接地址中的仓库名称)
Array_Repo_name[$conf_index]="$(get_config_wrapper "name")"
if [[ -z "${Array_Repo_name[conf_index]}" ]]; then
Array_Repo_name[$conf_index]="$(echo ${Array_Repo_url[conf_index]} | sed "s|\.git||g" | awk -F "/|:" '{print$NF}')"
Array_Repo_name[$conf_index]="$(echo ${Array_Repo_url[conf_index]} | awk -F "/|:" '{print$NF}')"
fi
## 代码仓库路径
Array_Repo_dir[$conf_index]="$(echo "${Array_Repo_url[conf_index]}" | sed "s|\.git||g" | awk -F "/|:" '{print $((NF - 1)) "_" $NF}')"
Array_Repo_dir[$conf_index]="$(echo "${Array_Repo_url[conf_index]}" | awk -F "/|:" '{print $((NF - 1)) "_" $NF}')"
Array_Repo_path[$conf_index]="$RepoDir/${Array_Repo_dir[conf_index]}"
## 代码仓库启用状态(默认启用)
if [[ "$(get_config_wrapper_bool "enable" "true")" == "false" ]]; then
Expand Down
4 changes: 2 additions & 2 deletions shell/update/git.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function git_clone_with_http_auth() {
if [[ "${url}" == http*://* ]] && [[ "${url}" != http*://*:*@* ]]; then
local protocol=$(echo $url | awk -F/ '{print $1}')
local baseurl=$(echo $url | awk -F/ '{print $3}')
url="${protocol}//${username}:${password}@${url#"$protocol"//"$baseurl"}"
url="${protocol}//${username}:${password}@${baseurl}${url#"$protocol"//"$baseurl"}"
fi

git_clone "${url}" "${dir}" "${branch}" "${text}"
Expand Down Expand Up @@ -109,7 +109,7 @@ function reset_romote_url_with_http_auth() {
if [[ "${url}" == http*://* ]] && [[ "${url}" != http*://*:*@* ]]; then
local protocol=$(echo $url | awk -F/ '{print $1}')
local baseurl=$(echo $url | awk -F/ '{print $3}')
url="${protocol}//${username}:${password}@${url#"$protocol"//"$baseurl"}"
url="${protocol}//${username}:${password}@${baseurl}${url#"$protocol"//"$baseurl"}"
fi

reset_romote_url "${work_dir}" "${url}"
Expand Down
2 changes: 1 addition & 1 deletion shell/utils/dep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ function pip_dep_install() {
echo "[dep.sh] ERROR: pip3 is not installed" >&2
return 1
}
pip3 install --no-cache-dir --break-system-packages "${pkg}"
pip3 install --no-cache-dir --break-system-packages --ignore-installed "${pkg}"
}

function pip_dep_uninstall() {
Expand Down