From 87158a720d8e145182fca182f9ecb081a5699f49 Mon Sep 17 00:00:00 2001 From: Jack <31696646+myspaghetti@users.noreply.github.com> Date: Mon, 27 Apr 2020 13:10:18 +0300 Subject: [PATCH] better++ error message for bash inside zsh --- macos-guest-virtualbox.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/macos-guest-virtualbox.sh b/macos-guest-virtualbox.sh index 3aee090..56f2469 100755 --- a/macos-guest-virtualbox.sh +++ b/macos-guest-virtualbox.sh @@ -2,7 +2,7 @@ # Push-button installer of macOS on VirtualBox # (c) myspaghetti, licensed under GPL2.0 or higher # url: https://github.com/myspaghetti/macos-guest-virtualbox -# version 0.90.2 +# version 0.90.3 # Dependencies: bash coreutils gzip unzip wget xxd dmg2img # Supported versions: @@ -126,9 +126,13 @@ if [[ "${SHELL}" =~ /bash ]]; then fi elif [[ "${SHELL}" =~ /zsh ]]; then if [[ -z "${ZSH_VERSION}" ]]; then - echo "Can't determine ZSH_VERSION. The script runs on /bin/bash by default." - echo "Manually load the script with zsh or edit the #! line at the top of the script" - echo "to point to zsh. Exiting." + echo "Can't determine ZSH_VERSION." + if [[ -n "${BASH_VERSION}" ]]; then + echo "The script appears to be running on bash inside zsh." + echo "Please explicitly execute the script with zsh or edit the #! at the top of the" + echo "script so it points to the zsh executable." + fi + echo "Exiting." exit elif [[ "${ZSH_VERSION:0:1}" -lt 5 ]]; then echo "Please run this script on zsh 5 or higher."