From a40a16ab98ccc1bc0a59046e86171af27015696a Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Mon, 8 Jul 2024 20:18:03 -0600 Subject: [PATCH] zsh instructions too (#13944) Release Notes: - N/A --- script/install.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/script/install.sh b/script/install.sh index 376e88d771..4141ae49a0 100755 --- a/script/install.sh +++ b/script/install.sh @@ -129,13 +129,23 @@ macos() { # Link the binary ln -sf "/Applications/$app/Contents/MacOS/cli" "$HOME/.local/bin/zed" - if which "zed" >/dev/null 2>&1; then + if [ "$(which "zed")" = "$HOME/.local/bin/zed" ]; then echo "Zed has been installed. Run with 'zed'" else echo "To run Zed from your terminal, you must add ~/.local/bin to your PATH" echo "Run:" - echo " echo 'export PATH=\$HOME/.local/bin:\$PATH' >> ~/.bashrc" - echo " source ~/.bashrc" + + case "$SHELL" in + *zsh) + echo " echo 'export PATH=\$HOME/.local/bin:\$PATH' >> ~/.zshrc" + echo " source ~/.zshrc" + ;; + *) + echo " echo 'export PATH=\$HOME/.local/bin:\$PATH' >> ~/.bashrc" + echo " source ~/.bashrc" + ;; + esac + echo "To run Zed now, '~/.local/bin/zed'" fi }