@@ -91,6 +91,7 @@ UPDATE_JSON="$({
9191 if (value.releaseUrl !== "https://github.com/Fei-Away/Codex-Dream-Skin/releases/latest") process.exit(1);
9292' " $UPDATE_JSON "
9393if /usr/bin/grep -R -n -E --exclude-dir=' .build' \
94+ --exclude-dir=' .build-*' \
9495 ' xattr|spctl[[:space:]]+--master-disable' \
9596 " $ROOT /menubar-app" " $ROOT /scripts/build-menubar-app.sh" " $ROOT /scripts/build-dmg.sh" > /dev/null; then
9697 printf ' Native distribution must not bypass Gatekeeper or remove quarantine attributes.\n' >&2
@@ -753,6 +754,41 @@ if /usr/bin/grep -F -q 'index($0, "--port " port)' "$ROOT/scripts/common-macos.s
753754 printf ' injector discovery still accepts a near-prefix port.\n' >&2
754755 exit 1
755756fi
757+ APPLY_SCRIPT=" $ROOT /scripts/apply-from-menubar-macos.sh"
758+ /usr/bin/grep -F -q ' if hot_reapply_theme "$PORT" 8000; then' " $APPLY_SCRIPT "
759+ /usr/bin/grep -F -q ' SESSION="off"' " $APPLY_SCRIPT "
760+ /usr/bin/grep -F -q ' if ! confirm "$PROMPT" "$OK_LABEL"; then' " $APPLY_SCRIPT "
761+ /usr/bin/grep -F -q ' "$SCRIPT_DIR/start-dream-skin-macos.sh" --restart-existing' " $APPLY_SCRIPT "
762+ if /usr/bin/grep -F -q ' CODEX_RUNNING=' " $APPLY_SCRIPT " ||
763+ /usr/bin/grep -F -q ' MENU_ACTION=' " $APPLY_SCRIPT " ||
764+ /usr/bin/grep -F -q ' OPEN_PROMPT=' " $APPLY_SCRIPT " ; then
765+ printf ' menu apply must preserve the original session-driven prompt model.\n' >&2
766+ exit 1
767+ fi
768+ HOT_LINE=" $( /usr/bin/grep -n ' hot_reapply_theme "$PORT" 8000' " $APPLY_SCRIPT " | /usr/bin/head -1 | /usr/bin/cut -d: -f1) "
769+ CONFIRM_LINE=" $( /usr/bin/grep -n ' if ! confirm "$PROMPT" "$OK_LABEL"; then' " $APPLY_SCRIPT " | /usr/bin/head -1 | /usr/bin/cut -d: -f1) "
770+ START_LINE=" $( /usr/bin/grep -n ' start-dream-skin-macos.sh" --restart-existing' " $APPLY_SCRIPT " | /usr/bin/head -1 | /usr/bin/cut -d: -f1) "
771+ if [ -z " $HOT_LINE " ] || [ -z " $CONFIRM_LINE " ] || [ -z " $START_LINE " ] ||
772+ [ " $CONFIRM_LINE " -ge " $HOT_LINE " ] ||
773+ [ " $HOT_LINE " -ge " $START_LINE " ]; then
774+ printf ' menu apply must keep its confirmation and hot-reapply before falling back to start.\n' >&2
775+ exit 1
776+ fi
777+ MENU_SOURCE=" $ROOT /menubar-app/Sources/CodexDreamSkinMenuBar/AppDelegate.swift"
778+ OPEN_CODEX_BODY=" $( /usr/bin/sed -n ' /@objc private func openCodex()/,/@objc private func openDreamSkinWebsite()/p' " $MENU_SOURCE " ) "
779+ /usr/bin/grep -F -q ' addActionItem("打开 ChatGPT", action: #selector(openCodex), enabled: !busy)' " $MENU_SOURCE "
780+ /usr/bin/grep -F -q ' showError(title: "未找到 ChatGPT", message: "请先安装并至少启动一次官方 ChatGPT / Codex 桌面应用。")' " $MENU_SOURCE "
781+ /usr/bin/grep -F -q ' guard !engineNeedsInstall(),' " $MENU_SOURCE "
782+ /usr/bin/grep -F -q ' let script = installedScript(named: "start-dream-skin-macos.sh") else {' " $MENU_SOURCE "
783+ /usr/bin/grep -F -q ' NSWorkspace.shared.openApplication(at: appURL, configuration: configuration)' " $MENU_SOURCE "
784+ /usr/bin/grep -F -q ' ScriptRunner.run(script: script)' " $MENU_SOURCE "
785+ /usr/bin/grep -F -q ' title: "无法打开 ChatGPT",' " $MENU_SOURCE "
786+ if /usr/bin/grep -F -q ' applyTitle = "打开并应用皮肤"' " $MENU_SOURCE " ||
787+ /usr/bin/grep -F -q ' runInstalledScript(named: "apply-from-menubar-macos.sh", operation: "打开 ChatGPT")' " $MENU_SOURCE " ||
788+ /usr/bin/printf ' %s\n' " $OPEN_CODEX_BODY " | /usr/bin/grep -F -q ' installBundledEngineIfNeeded(force:' ; then
789+ printf ' Open ChatGPT must keep its menu title and must not use menu apply or install the engine implicitly.\n' >&2
790+ exit 1
791+ fi
756792
757793# Corrupt or structurally incomplete state must be preserved and fail closed;
758794# otherwise pause/restore could overwrite evidence while a watcher survives.
0 commit comments