手动选择环境与配置不一致时自动更新 .ctms-env

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Cheng Zhou
2026-06-23 22:26:54 +08:00
parent b83c900109
commit 2df8d60172
+6
View File
@@ -196,6 +196,12 @@ pick_env() {
1) SELECTED_ENV="main" ;; 1) SELECTED_ENV="main" ;;
2) SELECTED_ENV="release" ;; 2) SELECTED_ENV="release" ;;
esac esac
# 手动选择与配置不一致时更新 .ctms-env
if [[ -n "$env" && "$SELECTED_ENV" != "$env" ]]; then
local file="$ROOT_DIR/.ctms-env"
sed -i.bak "s/^env *=.*/env = $SELECTED_ENV/" "$file" && rm -f "${file}.bak"
ctms_info "已将 .ctms-env 中的环境更新为: $SELECTED_ENV"
fi
} }
collect_install_options() { collect_install_options() {