From 893fc92f6d7fad58e52151045d7c9c660bbb6d83 Mon Sep 17 00:00:00 2001 From: kicer Date: Wed, 11 Nov 2026 22:17:43 +0800 Subject: [PATCH] =?UTF-8?q?fix(local):=20=E5=8F=98=E9=87=8F=E5=90=8D?= =?UTF-8?q?=E7=B4=A7=E8=B4=B4=E5=85=A8=E8=A7=92=E6=8B=AC=E5=8F=B7=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=20unbound=20variable=20/=20=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E4=B8=AD=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bash 3.2 在 UTF-8 下把紧跟变量名的全角字符算进标识符,`"$PREVIEW_PORT(office 文档)"` 会被当成 $PREVIEW_PORT(office 这个变量 → set -u 下直接炸,启动器在 preview 那步退出。 四处一律改成 ${VAR} 形式;其中 `$SKILLS_DIR(python3 未安装…` 是原有问题(只在没 python3 时触发)。 --- local/start.sh | 6 +++--- local/stop.sh | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/local/start.sh b/local/start.sh index 3b478c2..cddd916 100755 --- a/local/start.sh +++ b/local/start.sh @@ -1022,7 +1022,7 @@ SKILLS_DIR=$(skills_dir) [ -n "$SKILLS_DIR" ] || SKILLS_DIR="$ROOT/skills" # 配置里两个键都被删掉时的兼底 if sync_skills "$SKILLS_DIR"; then if [ "$PY_OK" = 1 ]; then ui_step "技能:$SKILLS_DIR" ok - else ui_step "技能:$SKILLS_DIR(python3 未安装,Python 技能会失败)" warn; fi + else ui_step "技能:${SKILLS_DIR}(python3 未安装,Python 技能会失败)" warn; fi else ui_step '技能目录不可用(检查配置里的 skills_root)' warn fi @@ -1033,7 +1033,7 @@ TASKS_DIR=$(cfg_get workspace_root) if PREVIEW_PORT=$(pick_preview_port); then start_preview - ui_step "预览网关:$HOST_ADDR:$PREVIEW_PORT(office 文档)" ok + ui_step "预览网关:$HOST_ADDR:${PREVIEW_PORT}(office 文档)" ok else PREVIEW_PORT='' warn '找不到空闲的预览端口(3100-3109),office 文档的预览将不可用' @@ -1088,7 +1088,7 @@ while :; do [ "$FF_OK" = 1 ] && check_mcp "$MCP_ASR_PORT" asr # 预览网关挂了不会影响别的功能,但它静默失败时用户只会看到空白预览,所以点名。 if [ -n "${PREVIEW_PORT:-}" ] && ! port_open "$PREVIEW_PORT"; then - warn "预览网关没起来(端口 $PREVIEW_PORT)——日志:local/.runtime/preview.log" + warn "预览网关没起来(端口 ${PREVIEW_PORT})——日志:local/.runtime/preview.log" fi if [ "$FIRST_RUN" = 1 ]; then # 首次安装:停在状态页,给一个按钮让用户自己点(先看完「首次使用」提示再进去)。 diff --git a/local/stop.sh b/local/stop.sh index 6a15bd2..f1c4beb 100755 --- a/local/stop.sh +++ b/local/stop.sh @@ -101,5 +101,5 @@ done if [ "$stopped" = 1 ]; then say '已停止' else - say "没有在运行($PORT、MCP 端口 $MCP_PORTS、预览端口 $pv_port 都空闲)" + say "没有在运行(${PORT}、MCP 端口 ${MCP_PORTS}、预览端口 $pv_port 都空闲)" fi