mirror of
https://github.com/mas-cli/mas
synced 2024-11-22 03:23:08 +00:00
🎨 Format swift
This commit is contained in:
parent
22c6c57743
commit
5aafd4c0aa
2 changed files with 11 additions and 11 deletions
|
@ -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")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue