From e92563bc4d77587bd195288056779256489092a7 Mon Sep 17 00:00:00 2001 From: Jack <31696646+myspaghetti@users.noreply.github.com> Date: Fri, 31 Jan 2020 10:18:39 +0200 Subject: [PATCH] evaluate "stages" value without newlines for bash 5 compatibility --- macos-guest-virtualbox.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/macos-guest-virtualbox.sh b/macos-guest-virtualbox.sh index e089860..f706980 100755 --- a/macos-guest-virtualbox.sh +++ b/macos-guest-virtualbox.sh @@ -2,7 +2,7 @@ # Semi-automatic installer of macOS on VirtualBox # (c) myspaghetti, licensed under GPL2.0 or higher # url: https://github.com/myspaghetti/macos-guest-virtualbox -# version 0.85.2 +# version 0.85.3 # Requirements: 40GB available storage on host # Dependencies: bash >= 4.3, xxd, gzip, unzip, wget, dmg2img, @@ -1252,12 +1252,13 @@ stages=' populate_macos_target delete_temporary_files ' +stages_without_newlines="$(printf "${stages}" | tr -d '\n')" # every stage name must be preceded and followed by a space character # for the command-line argument checking below to work [ -z "${1}" ] && for stage in ${stages}; do ${stage}; done && exit [ "${1}" = "documentation" ] && documentation && exit for argument in $@; do - [[ "${stages}" != *" ${argument} "* ]] && + [[ "${stages_without_newlines}" != *" ${argument} "* ]] && echo "Can't parse one or more specified arguments. See documentation" && echo "by entering the following command:" && echo " ${0} documentation" &&