From 312884b57e12f8e6f12d1e0224cb35e4c3ee834d Mon Sep 17 00:00:00 2001 From: img2tab <31696646+img2tab@users.noreply.github.com> Date: Wed, 6 Mar 2019 15:05:11 +0000 Subject: [PATCH] compartmentalizing dependency check --- macos-guest-virtualbox.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/macos-guest-virtualbox.sh b/macos-guest-virtualbox.sh index 258a705..ef340f9 100644 --- a/macos-guest-virtualbox.sh +++ b/macos-guest-virtualbox.sh @@ -2,7 +2,7 @@ # One-key semi-automatic installer of macOS on VirtualBox # (c) img2tab, licensed under GPL2.0 or higher # url: https://github.com/img2tab/macos-guest-virtualbox -# version 0.43 +# version 0.44 # Requirements: 33.5GB available storage on host # Dependencies: bash>=4.0, unzip, wget, dmg2img, @@ -66,6 +66,7 @@ read } # check dependencies +function check_dependencies() { if [ -z "${BASH_VERSION}" ]; then echo "Can't determine BASH_VERSION. Exiting." exit @@ -116,7 +117,7 @@ if [ -z "$(dmg2img -d 2>/dev/null)" ]; then chmod +x "dmg2img.exe" fi fi - +} # Done with dependencies # Prompt to delete existing virtual machine config: @@ -647,6 +648,7 @@ That'\''s it. Enjoy your virtual machine.' if [ -z "${1}" ]; then welcome + check_dependencies prompt_delete_existing_vm create_vm create_basesystem_vdi @@ -659,6 +661,7 @@ if [ -z "${1}" ]; then install_the_installer boot_macos_installer else + check_dependencies initialize_script_functions ${1} fi