update at 2025-10-26 10:44:30

This commit is contained in:
douboer
2025-10-26 10:44:30 +08:00
parent 233ea19779
commit 36f253374e

View File

@@ -95,6 +95,19 @@ elif [[ "$remote_url" =~ ^([^@]+@[^:]+):([^/]+)/(.+)\.git$ ]]; then
hostport=$(echo "${BASH_REMATCH[1]}" | cut -d@ -f2)
GITEA_URL="https://${hostport}"
GITEA_REPO="${BASH_REMATCH[2]}/${BASH_REMATCH[3]}"
elif [[ "$remote_url" =~ ^https?://([^/]+)(/.*)$ ]]; then
host="${BASH_REMATCH[1]}"
path="${BASH_REMATCH[2]}"
path="${path#/}"
# 去掉结尾的 .git
path="${path%.git}"
if [[ "$path" == gitea/* ]]; then
GITEA_URL="https://${host}/gitea"
path="${path#gitea/}"
else
GITEA_URL="https://${host}"
fi
GITEA_REPO="$path"
else
echo "❌ 无法解析远程地址: $remote_url"
exit 1