Avoid redownloading Monterey app if it already exists (#192)

This commit is contained in:
Nicholas Sherlock 2022-03-16 00:31:50 +13:00 committed by GitHub
parent 3080c87bbb
commit 670cd80d7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,18 +31,25 @@ all: Monterey-recovery.img
ln $< $@ || cp $< $@
ifeq ($(OS),MACOS)
Monterey-full.dmg : $(MONTEREY_APP)
hdiutil create -o "$@" -size 14g -layout GPTSPUD -fs HFS+J
hdiutil attach -noverify -mountpoint /Volumes/install_build "$@"
sudo "$</Contents/Resources/createinstallmedia" --volume /Volumes/install_build --nointeraction
hdiutil detach "/Volumes/Install macOS Monterey"
else
Monterey-full.dmg :
$(error "Building a full installer requires this script to be run on macOS, run 'make Monterey-recovery.img' instead")
endif
# Avoid redownloading Monterey if the app already exists
ifeq (,$(wildcard $(MONTEREY_APP)))
$(MONTEREY_APP) : InstallAssistant.pkg
sudo installer -pkg $< -target /
endif
else
Monterey-full.dmg :
$(error "Building a full installer requires this script to be run on macOS, run 'make Monterey-recovery.img' instead")
endif
Monterey-recovery.dmg : BaseSystem.dmg
rm -f $@