diff --git a/README.md b/README.md index c9f58be..fe6d7be 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,8 @@ Please consider staring this project. It helps me see how important this is for ## Usage +> **Warning:** Run this script with **bash**, not fish (or another shell). It uses bash-only syntax and will fail if run under fish. Keep `bash` in the commands below — do not replace it with `fish` or `source` the script. If fish is your default shell, a warning (dialog if whiptail is installed, otherwise a text prompt) will remind you before anything is installed. + To use this script paste the following in the Terminal: ```bash diff --git a/install.sh b/install.sh index 03b46ff..2357f55 100755 --- a/install.sh +++ b/install.sh @@ -6,12 +6,20 @@ if [ "$1" = "--skip-watermark" ]; then skip_watermark=true fi -# Detect fish shell and ask user to switch to bash (bash-only syntax) -if [ -n "${FISH_VERSION:-}" ] || case "$SHELL" in *fish*) ;; *) false ;; esac then - echo "Warning: fish shell detected." - echo "This script is written for bash and may have syntax issues under fish." - echo "Please switch to bash first and re-run it, e.g.: bash $0" - read -r -p "Press Enter to continue anyway, or Ctrl+C to cancel..." /dev/null; then + if ! whiptail --title "Warning: use bash, not fish" --yesno \ + "Your default shell appears to be fish.\n\nThis script must be run with bash. It uses bash-only syntax and will fail under fish.\n\nRun it with:\n bash install.sh\n\nContinue anyway?" 15 72; then + echo "Aborted. Please run this script with bash, not fish. e.g.: bash install.sh" + exit 1 + fi + else + echo "Warning: fish shell detected." + echo "This script must be run with bash, not fish (bash-only syntax)." + echo "Please run it with bash, e.g.: bash install.sh" + read -r -p "Press Enter to continue anyway, or Ctrl+C to cancel..." /dev/null; then + if ! whiptail --title "Warning: use bash, not fish" --yesno \ + "Your default shell appears to be fish.\n\nThis script must be run with bash. It uses bash-only syntax and will fail under fish.\n\nRun it with:\n bash installbeta.sh\n\nContinue anyway?" 15 72; then + echo "Aborted. Please run this script with bash, not fish. e.g.: bash installbeta.sh" + exit 1 + fi + else + echo "Warning: fish shell detected." + echo "This script must be run with bash, not fish (bash-only syntax)." + echo "Please run it with bash, e.g.: bash installbeta.sh" + read -r -p "Press Enter to continue anyway, or Ctrl+C to cancel..."