🐛 Disable purchase command on macOS 10.15

Documents #289.
This commit is contained in:
Chris Araman 2021-11-03 13:49:32 -07:00
parent bfed0a7605
commit 4660b4505b
No known key found for this signature in database
GPG key ID: BB4499D9E11B61E0

View file

@ -29,6 +29,12 @@ public struct PurchaseCommand: CommandProtocol {
/// Runs the command. /// Runs the command.
public func run(_ options: Options) -> Result<Void, MASError> { public func run(_ options: Options) -> Result<Void, MASError> {
if #available(macOS 10.15, *) {
// Purchases are no longer possible as of Catalina.
// https://github.com/mas-cli/mas/issues/289
return .failure(.notSupported)
}
// Try to download applications with given identifiers and collect results // Try to download applications with given identifiers and collect results
let appIds = options.appIds.filter { appId in let appIds = options.appIds.filter { appId in
if let product = appLibrary.installedApp(forId: appId) { if let product = appLibrary.installedApp(forId: appId) {