Merge app installer bundles for 10.13-10.15 (#145)

This commit is contained in:
Nindi Gill 2024-10-05 14:39:21 +10:00 committed by GitHub
parent 356cbe6312
commit 6358047ee9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View file

@ -41,14 +41,15 @@ enum InstallerCreator {
["installer", "-pkg", packageURL.path, "-target", mountPoint.path]
]
// workaround for macOS High Sierra
if installer.version.range(of: "^10\\.13\\.", options: .regularExpression) != nil {
// workaround for macOS High Sierra 10.13, macOS Mojave 10.14 and macOS Catalina 10.15
if installer.highSierraOrNewer, !installer.bigSurOrNewer {
argumentsArrays += [
["ditto", "/Applications/Install \(installer.name).app", "\(mountPoint.path)/Applications/Install \(installer.name).app"],
["rm", "-r", "/Applications/Install \(installer.name).app"]
]
}
// workaround for macOS Catalina 10.15 and newer
if installer.catalinaOrNewer {
argumentsArrays += [
["ditto", "\(mountPoint.path)Applications", "\(mountPoint.path)/Applications"],

View file

@ -769,6 +769,10 @@ struct Installer: Decodable, Hashable, Identifiable {
version.range(of: "^10\\.([7-9]|1[0-2])\\.", options: .regularExpression) != nil
}
var highSierraOrNewer: Bool {
bigSurOrNewer || version.range(of: "^10\\.1[3-5]\\.", options: .regularExpression) != nil
}
var catalinaOrNewer: Bool {
bigSurOrNewer || version.range(of: "^10\\.15\\.", options: .regularExpression) != nil
}