mirror of
https://github.com/mas-cli/mas
synced 2025-02-16 12:38:30 +00:00
Improve parameter names.
Partial #592 Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
This commit is contained in:
parent
586de07389
commit
2af2a42a88
2 changed files with 6 additions and 6 deletions
|
@ -58,14 +58,14 @@ extension Mas {
|
||||||
let apps: [SoftwareProduct] =
|
let apps: [SoftwareProduct] =
|
||||||
appIDs.isEmpty
|
appIDs.isEmpty
|
||||||
? appLibrary.installedApps
|
? appLibrary.installedApps
|
||||||
: appIDs.compactMap {
|
: appIDs.compactMap { appID in
|
||||||
if let appID = AppID($0) {
|
if let appID = AppID(appID) {
|
||||||
// argument is an AppID, lookup app by id using argument
|
// argument is an AppID, lookup app by id using argument
|
||||||
return appLibrary.installedApp(withAppID: appID)
|
return appLibrary.installedApp(withAppID: appID)
|
||||||
}
|
}
|
||||||
|
|
||||||
// argument is not an AppID, lookup app by name using argument
|
// 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
|
let promises = apps.map { installedApp in
|
||||||
|
|
|
@ -36,7 +36,7 @@ class MasStoreSearch: StoreSearch {
|
||||||
///
|
///
|
||||||
/// - Parameter searchTerm: a search term matched against app names
|
/// - Parameter searchTerm: a search term matched against app names
|
||||||
/// - Returns: A Promise of an Array of SearchResults matching searchTerm
|
/// - 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.
|
// Search for apps for compatible platforms, in order of preference.
|
||||||
// Macs with Apple Silicon can run iPad and iPhone apps.
|
// Macs with Apple Silicon can run iPad and iPhone apps.
|
||||||
var entities = [Entity.desktopSoftware]
|
var entities = [Entity.desktopSoftware]
|
||||||
|
@ -45,8 +45,8 @@ class MasStoreSearch: StoreSearch {
|
||||||
}
|
}
|
||||||
|
|
||||||
let results = entities.map { entity in
|
let results = entities.map { entity in
|
||||||
guard let url = searchURL(for: appName, inCountry: country, ofEntity: entity) else {
|
guard let url = searchURL(for: searchTerm, inCountry: country, ofEntity: entity) else {
|
||||||
fatalError("Failed to build URL for \(appName)")
|
fatalError("Failed to build URL for \(searchTerm)")
|
||||||
}
|
}
|
||||||
return loadSearchResults(url)
|
return loadSearchResults(url)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue