From 77fd457627f38da57991673fcc1296a72ef320f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Sat, 18 Jul 2026 11:35:39 -0400 Subject: [PATCH] install.sh: print the permanent PATH command for the user's shell MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The post-install guidance previously showed a one-time `export PATH=…` that dies with the terminal. Detect $SHELL and print the persistent command instead: append to ~/.zshrc / ~/.bash_profile (macOS) / ~/.bashrc (Linux), fish_add_path for fish (already persistent via universal variables), ~/.profile as the POSIX fallback. --- install.sh | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index ad83690..33e1ede 100644 --- a/install.sh +++ b/install.sh @@ -191,9 +191,23 @@ case ":$PATH:" in printf 'Run `kigi` to get started.\n' ;; *) - printf '\n%s is not on your PATH. Add it with:\n\n' "$BIN_DIR" - printf ' export PATH="%s:$PATH" # sh / bash / zsh (add to your shell rc)\n' "$BIN_DIR" - printf ' fish_add_path %s # fish\n\n' "$BIN_DIR" - printf 'Then run `kigi` to get started.\n' + printf '\n%s is not on your PATH. Add it permanently:\n\n' "$BIN_DIR" + case "${SHELL:-}" in + */zsh) + printf " echo 'export PATH=\"%s:\$PATH\"' >> ~/.zshrc\n" "$BIN_DIR" + ;; + */bash) + # macOS login shells read ~/.bash_profile; Linux reads ~/.bashrc. + if [ "$PLATFORM_OS" = "macos" ]; then BASH_RC="~/.bash_profile"; else BASH_RC="~/.bashrc"; fi + printf " echo 'export PATH=\"%s:\$PATH\"' >> %s\n" "$BIN_DIR" "$BASH_RC" + ;; + */fish) + printf ' fish_add_path %s\n' "$BIN_DIR" + ;; + *) + printf " echo 'export PATH=\"%s:\$PATH\"' >> ~/.profile\n" "$BIN_DIR" + ;; + esac + printf '\nThen open a new terminal (or source the file) and run `kigi` to get started.\n' ;; esac