diff --git a/TODO.md b/TODO.md index 7949d10..22e2d13 100644 --- a/TODO.md +++ b/TODO.md @@ -16,7 +16,7 @@ - [ ] Build update-menu checks per client when `Both` is selected. Both menus inspect Claude's installed plugins for every entry, so a Codex resource can start unchecked and the combined sync can remove it. (`scripts/lib/plugins.ps1:98`, `scripts/lib/plugins.sh:108`) - [ ] Keep shared MCPorter servers until neither client needs them. Reconciliation processes `shared` records even when only one client is selected; uninstalling that client with an empty selection removes servers still used by the other. (`scripts/lib/managed-extensions.py:463`, `scripts/commands/uninstall.ps1:59`, `scripts/commands/uninstall.sh:77`) - [ ] Manage global packages once across clients. With `--client both`, MCPorter is installed and recorded twice; QMD's global package can be removed during a Codex-only deselection while Claude still uses its plugin. (`scripts/lib/managed-extensions.py:342`, `scripts/lib/managed-extensions.py:378`, `scripts/lib/managed-extensions.py:463`) -- [ ] Fix Bash `auto` semantic retrieval selection. Both `test_semantic_retrieval_device()` and its caller read `$?` after a completed `if`, losing the benchmark's exit code; an unsuitable device produces an empty choice instead of `false`. (`scripts/lib/semantic-retrieval.sh:13`, `scripts/lib/install-options.sh:52`) +- [x] Fix Bash `auto` semantic retrieval selection. Both `test_semantic_retrieval_device()` and its caller read `$?` after a completed `if`, losing the benchmark's exit code; an unsuitable device produces an empty choice instead of `false`. (`scripts/lib/semantic-retrieval.sh:13`, `scripts/lib/install-options.sh:52`) - [ ] Make ordinary update dry-runs use the saved/current selection. Both menus bypass selection in dry-run and select every manifest entry, so the preview can diverge from the real update. (`scripts/lib/plugins.ps1:91`, `scripts/lib/plugins.sh:97`) - [ ] Reconcile resources whose ownership record remains but whose installation was removed manually. `ensure_cli()` and `ensure_mcporter()` return early from a ledger record without checking the actual CLI or server; normal sync cannot restore the missing resource. (`scripts/lib/managed-extensions.py:342`, `scripts/lib/managed-extensions.py:395`) - [ ] Update owned MCPorter itself on `--update`. `ensure_cli()` returns whenever its ledger record exists, so a selected MCPorter package never receives the requested update. (`scripts/lib/managed-extensions.py:342`) diff --git a/scripts/lib/install-options.sh b/scripts/lib/install-options.sh index e5e0a61..3fd9caf 100644 --- a/scripts/lib/install-options.sh +++ b/scripts/lib/install-options.sh @@ -49,8 +49,7 @@ read_semantic_retrieval_option() { y|Y|yes|Yes|YES) printf 'true\n'; return ;; n|N|no|No|NO) printf 'false\n'; return ;; a|A|auto|Auto|AUTO) - if test_semantic_retrieval_device "$root" "$home_path"; then printf 'true\n'; return; fi - status=$? + if test_semantic_retrieval_device "$root" "$home_path"; then printf 'true\n'; return; else status=$?; fi [ "$status" -eq 1 ] && { printf 'false\n'; return; } return "$status" ;; diff --git a/scripts/lib/semantic-retrieval.sh b/scripts/lib/semantic-retrieval.sh index ad607ba..1ba36aa 100644 --- a/scripts/lib/semantic-retrieval.sh +++ b/scripts/lib/semantic-retrieval.sh @@ -14,7 +14,8 @@ test_semantic_retrieval_device() { local root=$1 home_path=$2 summary=${3:-false} local arguments=("$root/scripts/lib/semantic-retrieval.py" benchmark --root "$root" --home "$home_path") [ "$summary" != true ] || arguments+=(--summary) - if python3 "${arguments[@]}" >&2; then return 0; fi - [ "$?" -eq 2 ] && return 1 + local status + if python3 "${arguments[@]}" >&2; then return 0; else status=$?; fi + [ "$status" -eq 2 ] && return 1 return 2 }