install.sh: print the permanent PATH command for the user's shell
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.
This commit is contained in:
+18
-4
@@ -191,9 +191,23 @@ case ":$PATH:" in
|
|||||||
printf 'Run `kigi` to get started.\n'
|
printf 'Run `kigi` to get started.\n'
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
printf '\n%s is not on your PATH. Add it with:\n\n' "$BIN_DIR"
|
printf '\n%s is not on your PATH. Add it permanently:\n\n' "$BIN_DIR"
|
||||||
printf ' export PATH="%s:$PATH" # sh / bash / zsh (add to your shell rc)\n' "$BIN_DIR"
|
case "${SHELL:-}" in
|
||||||
printf ' fish_add_path %s # fish\n\n' "$BIN_DIR"
|
*/zsh)
|
||||||
printf 'Then run `kigi` to get started.\n'
|
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
|
esac
|
||||||
|
|||||||
Reference in New Issue
Block a user