From 0aaa770561d1038f1cdb588ff97fc455861cb8a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Mon, 24 Aug 2026 21:08:58 -0400 Subject: [PATCH] Wizard: explicit step error propagation, honest final diagnosis Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01QKxGW1raAWaqeU8WdHsMsp --- bin/omarchy-cn-setup | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/bin/omarchy-cn-setup b/bin/omarchy-cn-setup index 1f9cd3d3..29002165 100755 --- a/bin/omarchy-cn-setup +++ b/bin/omarchy-cn-setup @@ -81,12 +81,13 @@ step_dev_mirror() { } step_apps() { - local catalog picks app - catalog=$(omarchy-cn-app-list | tail -n +2 | awk '{print $1}') + local catalog picks app rc=0 + catalog=$(omarchy-cn-app-list | tail -n +2 | awk '{print $1}') || return 1 picks=$(gum choose --no-limit --header "选择要安装的国内应用(空格多选,回车确认)" <<<"$catalog" || true) for app in $picks; do - omarchy-cn-app-install "$app" + omarchy-cn-app-install "$app" || rc=1 done + return $rc } step_privacy() { @@ -111,5 +112,9 @@ run_step privacy "隐私与诊断" step_privacy echo echo "==> 最终检查" -omarchy-cn-doctor all || true -echo "OmarchyCN 初始化完成。随时可用 omarchycn setup 重进任一步骤。" +if omarchy-cn-doctor all; then + echo "OmarchyCN 初始化完成。随时可用 omarchycn setup 重进任一步骤。" +else + echo "初始化步骤已执行,但诊断存在失败项(见上),修复后可重跑 omarchycn setup" >&2 + exit 1 +fi