diff --git a/Sources/mas/Commands/Upgrade.swift b/Sources/mas/Commands/Upgrade.swift index db825b6..41054d2 100644 --- a/Sources/mas/Commands/Upgrade.swift +++ b/Sources/mas/Commands/Upgrade.swift @@ -58,14 +58,14 @@ extension Mas { let apps: [SoftwareProduct] = appIDs.isEmpty ? appLibrary.installedApps - : appIDs.compactMap { - if let appID = AppID($0) { + : appIDs.compactMap { appID in + if let appID = AppID(appID) { // argument is an AppID, lookup app by id using argument return appLibrary.installedApp(withAppID: appID) } // argument is not an AppID, lookup app by name using argument - return appLibrary.installedApp(named: $0) + return appLibrary.installedApp(named: appID) } let promises = apps.map { installedApp in diff --git a/Sources/mas/Controllers/MasStoreSearch.swift b/Sources/mas/Controllers/MasStoreSearch.swift index a2cf5b2..2dc7ff4 100644 --- a/Sources/mas/Controllers/MasStoreSearch.swift +++ b/Sources/mas/Controllers/MasStoreSearch.swift @@ -36,7 +36,7 @@ class MasStoreSearch: StoreSearch { /// /// - Parameter searchTerm: a search term matched against app names /// - Returns: A Promise of an Array of SearchResults matching searchTerm - func search(for appName: String) -> Promise<[SearchResult]> { + func search(for searchTerm: String) -> Promise<[SearchResult]> { // Search for apps for compatible platforms, in order of preference. // Macs with Apple Silicon can run iPad and iPhone apps. var entities = [Entity.desktopSoftware] @@ -45,8 +45,8 @@ class MasStoreSearch: StoreSearch { } let results = entities.map { entity in - guard let url = searchURL(for: appName, inCountry: country, ofEntity: entity) else { - fatalError("Failed to build URL for \(appName)") + guard let url = searchURL(for: searchTerm, inCountry: country, ofEntity: entity) else { + fatalError("Failed to build URL for \(searchTerm)") } return loadSearchResults(url) }