From 3e5d14ee2abcda5c4d50ce74e9ce7723fa714932 Mon Sep 17 00:00:00 2001 From: yulonglin <30549145+yulonglin@users.noreply.github.com> Date: Fri, 24 Jul 2026 20:27:50 -0700 Subject: [PATCH] fix(deploy): guard associative-array lookup so extension sync can't abort deploy.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Under `set -euo pipefail` (deploy.sh line 15), zsh treats reading a missing associative-array key as a fatal error that terminates the shell outright — it is not a normal non-zero exit, so the `|| log_warning` guard on the deploy_editor_settings call cannot catch it. Any installed editor extension absent from config/vscode_extensions.txt therefore killed deploy.sh at the extension-sync step (~line 381 of 1340), silently skipping every later component: developer config files, Finicky, Ghostty, Zed, gitui, Claude, Codex, Serena, Mouseless, Alfred, text replacements, and all launchd/cron jobs. Add the `:-` default so a missing key reads as empty. wanted_map was the only associative array in the repo read with a possibly-absent key; the other three (SSH_THEME_OVERRIDES, pids, git_settings) only read keys they iterate. Co-Authored-By: Claude Opus 5 --- scripts/shared/helpers.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/shared/helpers.sh b/scripts/shared/helpers.sh index ff99028c..50cb950d 100644 --- a/scripts/shared/helpers.sh +++ b/scripts/shared/helpers.sh @@ -1632,7 +1632,9 @@ install_editor_extensions() { typeset -a to_remove for ext in "${installed[@]}"; do [[ -z "$ext" ]] && continue - if [[ -z "${wanted_map[${ext:l}]}" ]]; then + # `:-` is required: under `set -u`, reading a missing associative-array key + # is a fatal zsh error (kills the whole script, not catchable with `||`). + if [[ -z "${wanted_map[${ext:l}]:-}" ]]; then to_remove+=("$ext") fi done