mirror of
https://github.com/TommyFang2077/dsh-desktop.git
synced 2026-08-17 09:06:36 +08:00
fix: tolerate stale proxy metadata during setup
This commit is contained in:
@@ -45,13 +45,6 @@ AUTH="Authorization: token $GITEA_TOKEN"
|
|||||||
user=$(curl --fail --silent --show-error -H "$AUTH" "$GITEA_BASE_URL/api/v1/user")
|
user=$(curl --fail --silent --show-error -H "$AUTH" "$GITEA_BASE_URL/api/v1/user")
|
||||||
repo=$(curl --fail --silent --show-error -H "$AUTH" "$GITEA_BASE_URL/api/v1/repos/$GITEA_OWNER/$GITEA_REPO")
|
repo=$(curl --fail --silent --show-error -H "$AUTH" "$GITEA_BASE_URL/api/v1/repos/$GITEA_OWNER/$GITEA_REPO")
|
||||||
printf '已认证:%s;仓库:%s\n' "$(printf '%s' "$user" | jq -r .login)" "$(printf '%s' "$repo" | jq -r .full_name)"
|
printf '已认证:%s;仓库:%s\n' "$(printf '%s' "$user" | jq -r .login)" "$(printf '%s' "$repo" | jq -r .full_name)"
|
||||||
case "$(printf '%s' "$repo" | jq -r .html_url)" in
|
|
||||||
https://*) ;;
|
|
||||||
*)
|
|
||||||
printf '%bGitea API 仍生成 HTTP 链接。请先把 app.ini 的 [server] ROOT_URL 改为 https://git.fangsiyuan.top/ 并重启 Gitea。%b\n' "$RED" "$RESET" >&2
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
[[ "$(printf '%s' "$repo" | jq -r .mirror)" == 'true' ]] || {
|
[[ "$(printf '%s' "$repo" | jq -r .mirror)" == 'true' ]] || {
|
||||||
printf '%b仓库不是 pull mirror,发布脚本无法同步 GitHub tag。%b\n' "$RED" "$RESET" >&2
|
printf '%b仓库不是 pull mirror,发布脚本无法同步 GitHub tag。%b\n' "$RED" "$RESET" >&2
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
Reference in New Issue
Block a user