Re-enable purchase.

`purchase` seems to work on macOS 12+.

Resolve #289

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
This commit is contained in:
Ross Goldberg 2024-09-16 10:27:14 -04:00
parent 622a154fb9
commit 5676dcb797
No known key found for this signature in database
2 changed files with 1 additions and 11 deletions

View file

@ -29,12 +29,6 @@ public struct PurchaseCommand: CommandProtocol {
/// Runs the command.
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
let appIds = options.appIds.filter { appId in
if let product = appLibrary.installedApp(forId: appId) {

View file

@ -20,11 +20,7 @@ public class PurchaseCommandSpec: QuickSpec {
it("purchases apps") {
let cmd = PurchaseCommand()
let result = cmd.run(PurchaseCommand.Options(appIds: []))
expect(result)
.to(
beFailure { error in
expect(error) == .notSupported
})
expect(result).to(beSuccess())
}
}
}