Skip to content

Commit

Permalink
Support macOS Sequoia downloads (#165)
Browse files Browse the repository at this point in the history
* Add macOS Sequoia catalogs

* Increase download output width
  • Loading branch information
ninxsoft committed Jun 11, 2024
1 parent 355d95c commit e330bc7
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 15 deletions.
13 changes: 7 additions & 6 deletions Mist/Commands/Download/DownloadFirmwareOptions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ struct DownloadFirmwareOptions: ParsableArguments {
@Argument(help: """
Specify a macOS name, version or build to download:
Name │ Version │ Build
───────────────────┼─────────┼──────
macOS Sonoma │ 14.x │ 23xyz
macOS Ventura │ 13.x │ 22xyz
macOS Monterey │ 12.x │ 21xyz
macOS Big Sur │ 11.x │ 20xyz
Name │ Version │ Build
───────────────┼─────────┼──────
macOS Sequoia | 15.x │ 24xyz
macOS Sonoma │ 14.x │ 23xyz
macOS Ventura │ 13.x │ 22xyz
macOS Monterey │ 12.x │ 21xyz
macOS Big Sur │ 11.x │ 20xyz
Note: Specifying a macOS name will assume the latest version and build of that particular macOS.
Note: Specifying a macOS version will look for an exact match, otherwise assume the latest build of that particular macOS.
Expand Down
1 change: 1 addition & 0 deletions Mist/Commands/Download/DownloadInstallerOptions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ struct DownloadInstallerOptions: ParsableArguments {
Name │ Version │ Build
───────────────────┼─────────┼──────
macOS Sequoia │ 15.x │ 24xyz
macOS Sonoma │ 14.x │ 23xyz
macOS Ventura │ 13.x │ 22xyz
macOS Monterey │ 12.x │ 21xyz
Expand Down
13 changes: 7 additions & 6 deletions Mist/Commands/List/ListFirmwareOptions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ struct ListFirmwareOptions: ParsableArguments {
@Argument(help: """
Optionally specify a macOS name, version or build to filter the list results:
Name │ Version │ Build
───────────────────┼─────────┼──────
macOS Sonoma │ 14.x │ 23xyz
macOS Ventura │ 13.x │ 22xyz
macOS Monterey │ 12.x │ 21xyz
macOS Big Sur │ 11.x │ 20xyz
Name │ Version │ Build
───────────────┼─────────┼──────
macOS Sequoia │ 15.x │ 24xyz
macOS Sonoma │ 14.x │ 23xyz
macOS Ventura │ 13.x │ 22xyz
macOS Monterey │ 12.x │ 21xyz
macOS Big Sur │ 11.x │ 20xyz
Note: Specifying a macOS name will assume the latest version and build of that particular macOS.
Note: Specifying a macOS version will look for an exact match, otherwise assume the latest build of that particular macOS.
Expand Down
1 change: 1 addition & 0 deletions Mist/Commands/List/ListInstallerOptions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ struct ListInstallerOptions: ParsableArguments {
Name │ Version │ Build
───────────────────┼─────────┼──────
macOS Sequoia │ 15.x │ 24xyz
macOS Sonoma │ 14.x │ 23xyz
macOS Ventura │ 13.x │ 22xyz
macOS Monterey │ 12.x │ 21xyz
Expand Down
2 changes: 1 addition & 1 deletion Mist/Helpers/Downloader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Foundation

/// Helper Class used to download macOS Firmwares and Installers.
class Downloader: NSObject {
private static let maximumWidth: Int = 80
private static let maximumWidth: Int = 95
private var temporaryURL: URL?
private var sourceURL: URL?
private var current: Int64 = 0
Expand Down
15 changes: 14 additions & 1 deletion Mist/Model/Catalog.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ enum Catalog: String, CaseIterable {
case `public`

static var urls: [String] {
allCases.map(\.url)
allCases.map(\.url) + allCases.map(\.sequioaURL)
}

var url: String {
Expand All @@ -27,4 +27,17 @@ enum Catalog: String, CaseIterable {
"https://swscan.apple.com/content/catalogs/others/index-14beta-14-13-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz"
}
}

private var sequioaURL: String {
switch self {
case .standard:
"https://swscan.apple.com/content/catalogs/others/index-15-14-13-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz"
case .customer: // swiftlint:disable:next line_length
"https://swscan.apple.com/content/catalogs/others/index-15customerseed-15-14-13-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz"
case .developer:
"https://swscan.apple.com/content/catalogs/others/index-15seed-15-14-13-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz"
case .public:
"https://swscan.apple.com/content/catalogs/others/index-15beta-15-14-13-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz"
}
}
}
4 changes: 3 additions & 1 deletion Mist/Model/Firmware.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ struct Firmware: Decodable {
var name: String {
var name: String = ""

if version.range(of: "^14", options: .regularExpression) != nil {
if version.range(of: "^15", options: .regularExpression) != nil {
name = "macOS Sequoia"
} else if version.range(of: "^14", options: .regularExpression) != nil {
name = "macOS Sonoma"
} else if version.range(of: "^13", options: .regularExpression) != nil {
name = "macOS Ventura"
Expand Down

0 comments on commit e330bc7

Please sign in to comment.