From cd421768599dc086b42725d558b4bcf076d292a7 Mon Sep 17 00:00:00 2001 From: Ross Goldberg <484615+rgoldberg@users.noreply.github.com> Date: Thu, 3 Oct 2024 12:30:01 -0400 Subject: [PATCH] Rename apps property of Upgrade as appIds. Resolve #542 Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com> --- Sources/mas/Commands/Upgrade.swift | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Sources/mas/Commands/Upgrade.swift b/Sources/mas/Commands/Upgrade.swift index ce7be35af..603902e40 100644 --- a/Sources/mas/Commands/Upgrade.swift +++ b/Sources/mas/Commands/Upgrade.swift @@ -18,7 +18,7 @@ extension Mas { ) @Argument(help: "app(s) to upgrade") - var apps: [String] = [] + var appIds: [String] = [] /// Runs the command. func run() throws { @@ -43,9 +43,8 @@ extension Mas { apps.map { "\($0.installedApp.appName) (\($0.installedApp.bundleVersion)) -> (\($0.storeApp.version))" } .joined(separator: "\n")) - let appIds = apps.map(\.installedApp.itemIdentifier.uint64Value) do { - try downloadAll(appIds).wait() + try downloadAll(apps.map(\.installedApp.itemIdentifier.uint64Value)).wait() } catch { throw error as? MASError ?? .downloadFailed(error: error as NSError) } @@ -56,9 +55,9 @@ extension Mas { storeSearch: StoreSearch ) throws -> [(SoftwareProduct, SearchResult)] { let apps: [SoftwareProduct] = - apps.isEmpty + appIds.isEmpty ? appLibrary.installedApps - : apps.compactMap { + : appIds.compactMap { if let appId = UInt64($0) { // if argument a UInt64, lookup app by id using argument return appLibrary.installedApp(forId: appId)