From 31ef107dbe8519af8a18a661199977b88995ef03 Mon Sep 17 00:00:00 2001 From: Hunter Clarke Date: Fri, 30 Jun 2023 13:12:19 -0400 Subject: [PATCH] Uses zsh if zsh is installed Currently, the install script creates a .zshrc file, then uses the presence of that file as the indication that the system uses zsh. Instead, test that zsh is installed before taking steps to use zsh. --- install.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index dfb7fcc..d22c11a 100755 --- a/install.sh +++ b/install.sh @@ -50,11 +50,11 @@ if [ ! -f "$HOME/.bashrc" ]; then touch "$HOME/.bashrc" fi -if [ ! -f "$HOME/.zshrc" ]; then +if [ -x "$(command -v zsh)" ] && [ ! -f "$HOME/.zshrc" ]; then touch "$HOME/.zshrc" fi -if [ -f "$HOME/.zshrc" ]; then +if [ -x "$(command -v zsh)" ]; then echo "" >> "$HOME/.zshrc" echo "export PATH=\"$BINARY_PATH:\$PATH\"" >> "$HOME/.zshrc" fi @@ -68,7 +68,7 @@ fi if [ -f "$HOME/.bashrc" ]; then source "$HOME/.bashrc" fi -if [ -f "$HOME/.zshrc" ]; then +if [ -x "$(command -v zsh)" ]; then zsh source "$HOME/.zshrc" -fi \ No newline at end of file +fi