🎨 Format swift

This commit is contained in:
Ben Chatelain 2024-02-17 22:58:11 -07:00
parent 22c6c57743
commit 5aafd4c0aa
2 changed files with 11 additions and 11 deletions

View file

@ -84,6 +84,6 @@ public struct OutdatedOptions: OptionsProtocol {
public static func evaluate(_ mode: CommandMode) -> Result<OutdatedOptions, CommandantError<MASError>> {
create
<*> mode <| Switch(flag: nil, key: "verbose", usage: "Show warnings about apps")
<*> mode <| Switch(flag: nil, key: "verbose", usage: "Show warnings about apps")
}
}

View file

@ -65,18 +65,18 @@ public struct UpgradeCommand: CommandProtocol {
}
private func findOutdatedApps(_ options: Options) throws -> [(SoftwareProduct, SearchResult)] {
let apps: [SoftwareProduct] = options.apps.isEmpty
let apps: [SoftwareProduct] =
options.apps.isEmpty
? appLibrary.installedApps
:
options.apps.compactMap {
if let appId = UInt64($0) {
// if argument a UInt64, lookup app by id using argument
return appLibrary.installedApp(forId: appId)
} else {
// if argument not a UInt64, lookup app by name using argument
return appLibrary.installedApp(named: $0)
}
: options.apps.compactMap {
if let appId = UInt64($0) {
// if argument a UInt64, lookup app by id using argument
return appLibrary.installedApp(forId: appId)
} else {
// if argument not a UInt64, lookup app by name using argument
return appLibrary.installedApp(named: $0)
}
}
let promises = apps.map { installedApp in
// only upgrade apps whose local version differs from the store version