fixed cygwin dmg2img condition

This commit is contained in:
My Spaghetti
2020-08-03 05:03:09 +03:00
parent 7e67c3b653
commit 261b2bb61e
+6 -6
View File
@@ -2,7 +2,7 @@
# Push-button installer of macOS on VirtualBox # Push-button installer of macOS on VirtualBox
# (c) myspaghetti, licensed under GPL2.0 or higher # (c) myspaghetti, licensed under GPL2.0 or higher
# url: https://github.com/myspaghetti/macos-virtualbox # url: https://github.com/myspaghetti/macos-virtualbox
# version 0.96.5 # version 0.96.6
# Dependencies: bash coreutils gzip unzip wget xxd dmg2img # Dependencies: bash coreutils gzip unzip wget xxd dmg2img
# Supported versions: # Supported versions:
@@ -300,7 +300,8 @@ if [[ -z "$(dmg2img -d 2>/dev/null)" ]]; then
if [[ -z "$(cygcheck -V 2>/dev/null)" ]]; then if [[ -z "$(cygcheck -V 2>/dev/null)" ]]; then
echo "Please install the package dmg2img." echo "Please install the package dmg2img."
exit exit
elif [[ -z "$("${PWD%%/}/dmg2img.exe" -d 2>/dev/null)" ]]; then fi
if [[ -z "$("${PWD%%/}/dmg2img.exe" -d 2>/dev/null)" ]]; then
if [[ -z "${PWD}" ]]; then echo "PWD environment variable is not set. Exiting."; exit; fi if [[ -z "${PWD}" ]]; then echo "PWD environment variable is not set. Exiting."; exit; fi
echo "Locally installing dmg2img" echo "Locally installing dmg2img"
wget "http://vu1tur.eu.org/tools/dmg2img-1.6.6-win32.zip" \ wget "http://vu1tur.eu.org/tools/dmg2img-1.6.6-win32.zip" \
@@ -313,11 +314,10 @@ if [[ -z "$(dmg2img -d 2>/dev/null)" ]]; then
unzip -oj "dmg2img-1.6.6-win32.zip" "dmg2img.exe" unzip -oj "dmg2img-1.6.6-win32.zip" "dmg2img.exe"
rm "dmg2img-1.6.6-win32.zip" rm "dmg2img-1.6.6-win32.zip"
chmod +x "dmg2img.exe" chmod +x "dmg2img.exe"
elif [[ -n "$("${PWD%%/}/dmg2img.exe" -d 2>/dev/null)" ]]; then
function dmg2img() {
"${PWD%%/}/dmg2img.exe" "$@"
}
fi fi
function dmg2img() {
"${PWD%%/}/dmg2img.exe" "$@"
}
fi fi
# set Apple software update catalog URL according to macOS version # set Apple software update catalog URL according to macOS version