feat(install): optional add-ons via --with and interactive prompt

Wire install_<name>.sh into the main installer through a shared catalog
so fnm/pyenv/nvm (and future tools) share one CLI and prompt path.
This commit is contained in:
Jeffrey
2026-08-07 14:23:30 +08:00
parent 42c8305871
commit bff5ceddf0
3 changed files with 160 additions and 8 deletions
+9
View File
@@ -99,6 +99,15 @@ grep -Fq '"$ZSH_CONFIGS_DIR"/*(DN)' "$ROOT/.zshrc" || fail "existing extensionle
grep -Fq '_resolve_trash_cmd' "$ROOT/.zshrc" || fail "trash-backed rm helper is missing"
grep -Fq 'libglib2.0-bin' "$ROOT/install.sh" || fail "Ubuntu Trash support is not installed"
grep -Fq 'deploy.sh' "$ROOT/install.sh" || fail "install.sh does not invoke deploy.sh"
grep -Fq 'OPTIONAL_ADDONS=' "$ROOT/install.sh" || fail "install.sh missing OPTIONAL_ADDONS catalog"
grep -Fq -- '--with' "$ROOT/install.sh" || fail "install.sh missing --with option"
# --with parses known add-ons and rejects unknown ones without network.
if HOME="$TEMP_DIR" PATH="/usr/bin:/bin" bash "$ROOT/install.sh" --with nosuch >/dev/null 2>&1; then
fail "install.sh accepted an unknown --with add-on"
fi
if ! HOME="$TEMP_DIR" PATH="/usr/bin:/bin" bash "$ROOT/install.sh" --help >/dev/null; then
fail "install.sh --help failed"
fi
grep -Fq 'brew shellenv' "$ROOT/.zshenv" || fail "Homebrew is not initialized in .zshenv"
grep -Fq '/usr/local/bin/brew' "$ROOT/.zshenv" || fail "Intel Homebrew path is missing from .zshenv"
grep -Fq '$HOME/.local/bin' "$ROOT/.zshenv" || fail "~/.local/bin is not added in .zshenv"