From 4973c86955c87ccec9c14d239bf8a3ace0965697 Mon Sep 17 00:00:00 2001 From: haixuanTao Date: Tue, 17 Sep 2024 14:08:09 +0200 Subject: [PATCH] Use -z $BASH to detect bash script --- install.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/install.sh b/install.sh index 242c744c..26e0f22e 100755 --- a/install.sh +++ b/install.sh @@ -195,10 +195,7 @@ else echo "" fi -read -p "Do you want to add $dest to your PATH automatically? (y/n): " response - -if [[ "$response" =~ ^([yY][eE][sS]|[yY])$ ]]; then - if [ "$SHELL" = "/bin/bash" ]; then +if [ -z "$BASH" ]; then if ! grep -q "$dest" ~/.bashrc; then echo "Adding $dest to PATH in ~/.bashrc" echo "export PATH=\$PATH:$dest" >> ~/.bashrc