Fix ISO unmounting for macOS betas

This commit is contained in:
Nindi Gill 2023-06-10 00:14:17 +10:00
parent d074db20ea
commit 5491ae6cf5
No known key found for this signature in database
GPG key ID: FF9A7FD590D4F4B1

View file

@ -406,7 +406,19 @@ class TaskManager: ObservableObject {
try await InstallMediaCreator.create(createInstallMediaURL, mountPoint: installer.temporaryISOMountPointURL)
},
MistTask(type: .unmount, description: "temporary Disk Image") {
if FileManager.default.fileExists(atPath: installer.temporaryISOMountPointURL.path) {
try await DiskImageUnmounter.unmount(installer.temporaryISOMountPointURL)
}
guard let major: Substring = installer.version.split(separator: ".").first else {
return
}
let url: URL = URL(fileURLWithPath: "/Volumes/Install macOS \(major) beta")
if FileManager.default.fileExists(atPath: url.path) {
try await DiskImageUnmounter.unmount(url)
}
},
MistTask(type: .convert, description: "temporary Disk Image to ISO") {
try await ISOConverter.convert(temporaryImageURL, destination: temporaryCDRURL)