From a9e58429ef8b220006db5fe1d3ee2786da4f20bb Mon Sep 17 00:00:00 2001 From: Arvin <62139570+wnlen@users.noreply.github.com> Date: Tue, 14 Apr 2026 23:18:25 +0800 Subject: [PATCH] fix: persist install subscription only after successful config generation --- install.sh | 3 +++ scripts/core/config.sh | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index b1b83ab..2b10ed9 100755 --- a/install.sh +++ b/install.sh @@ -41,6 +41,9 @@ prompt_subscription_if_needed if [ -n "$(subscription_url 2>/dev/null || true)" ]; then if generate_config; then + if [ -n "${INSTALL_PENDING_SUBSCRIPTION_URL:-}" ]; then + write_env_value "CLASH_SUBSCRIPTION_URL" "$INSTALL_PENDING_SUBSCRIPTION_URL" + fi echo "✨ 订阅已生效" post_install_verify else diff --git a/scripts/core/config.sh b/scripts/core/config.sh index a8faa60..c9da7e2 100644 --- a/scripts/core/config.sh +++ b/scripts/core/config.sh @@ -2816,7 +2816,7 @@ prompt_subscription_if_needed() { fi input_fmt="$(detect_subscription_format "$input_url")" - write_env_value "CLASH_SUBSCRIPTION_URL" "$input_url" + INSTALL_PENDING_SUBSCRIPTION_URL="$input_url" bootstrap_subscription_from_install_input "$input_url" "$input_fmt" "default" }