fix: persist install subscription only after successful config generation

This commit is contained in:
Arvin
2026-04-14 23:18:25 +08:00
parent fb3820f733
commit a9e58429ef
2 changed files with 4 additions and 1 deletions
+3
View File
@@ -41,6 +41,9 @@ prompt_subscription_if_needed
if [ -n "$(subscription_url 2>/dev/null || true)" ]; then if [ -n "$(subscription_url 2>/dev/null || true)" ]; then
if generate_config; then if generate_config; then
if [ -n "${INSTALL_PENDING_SUBSCRIPTION_URL:-}" ]; then
write_env_value "CLASH_SUBSCRIPTION_URL" "$INSTALL_PENDING_SUBSCRIPTION_URL"
fi
echo "✨ 订阅已生效" echo "✨ 订阅已生效"
post_install_verify post_install_verify
else else
+1 -1
View File
@@ -2816,7 +2816,7 @@ prompt_subscription_if_needed() {
fi fi
input_fmt="$(detect_subscription_format "$input_url")" 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" bootstrap_subscription_from_install_input "$input_url" "$input_fmt" "default"
} }