mirror of
https://github.com/mas-cli/mas
synced 2024-11-22 11:33:13 +00:00
🧹 Lint
This commit is contained in:
parent
99bd7533b1
commit
55b7615763
4 changed files with 4 additions and 4 deletions
|
@ -31,7 +31,7 @@ public struct InstallCommand: CommandProtocol {
|
||||||
/// Runs the command.
|
/// Runs the command.
|
||||||
public func run(_ options: Options) -> Result<Void, MASError> {
|
public func run(_ options: Options) -> Result<Void, MASError> {
|
||||||
// Try to download applications with given identifiers and collect results
|
// Try to download applications with given identifiers and collect results
|
||||||
let downloadResults = options.appIds.compactMap { (appId) -> MASError? in
|
let downloadResults = options.appIds.compactMap { appId -> MASError? in
|
||||||
if let product = appLibrary.installedApp(forId: appId), !options.forceInstall {
|
if let product = appLibrary.installedApp(forId: appId), !options.forceInstall {
|
||||||
printWarning("\(product.appName) is already installed")
|
printWarning("\(product.appName) is already installed")
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -70,7 +70,7 @@ public struct LuckyCommand: CommandProtocol {
|
||||||
fileprivate func install(_ appId: UInt64, options: Options) -> Result<Void, MASError> {
|
fileprivate func install(_ appId: UInt64, options: Options) -> Result<Void, MASError> {
|
||||||
// Try to download applications with given identifiers and collect results
|
// Try to download applications with given identifiers and collect results
|
||||||
let downloadResults = [appId]
|
let downloadResults = [appId]
|
||||||
.compactMap { (appId) -> MASError? in
|
.compactMap { appId -> MASError? in
|
||||||
if let product = appLibrary.installedApp(forId: appId), !options.forceInstall {
|
if let product = appLibrary.installedApp(forId: appId), !options.forceInstall {
|
||||||
printWarning("\(product.appName) is already installed")
|
printWarning("\(product.appName) is already installed")
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -30,7 +30,7 @@ public struct PurchaseCommand: CommandProtocol {
|
||||||
/// Runs the command.
|
/// Runs the command.
|
||||||
public func run(_ options: Options) -> Result<Void, MASError> {
|
public func run(_ options: Options) -> Result<Void, MASError> {
|
||||||
// Try to download applications with given identifiers and collect results
|
// Try to download applications with given identifiers and collect results
|
||||||
let downloadResults = options.appIds.compactMap { (appId) -> MASError? in
|
let downloadResults = options.appIds.compactMap { appId -> MASError? in
|
||||||
if let product = appLibrary.installedApp(forId: appId) {
|
if let product = appLibrary.installedApp(forId: appId) {
|
||||||
printWarning("\(product.appName) has already been purchased.")
|
printWarning("\(product.appName) has already been purchased.")
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -20,7 +20,7 @@ class AppLibraryMock: AppLibrary {
|
||||||
}
|
}
|
||||||
|
|
||||||
func uninstallApp(app: SoftwareProduct) throws {
|
func uninstallApp(app: SoftwareProduct) throws {
|
||||||
if !installedApps.contains(where: { (product) -> Bool in
|
if !installedApps.contains(where: { product -> Bool in
|
||||||
app.itemIdentifier == product.itemIdentifier
|
app.itemIdentifier == product.itemIdentifier
|
||||||
}) {
|
}) {
|
||||||
throw MASError.notInstalled
|
throw MASError.notInstalled
|
||||||
|
|
Loading…
Reference in a new issue