diff --git a/Sources/AppBundle/command/impl/ExecAndForgetCommand.swift b/Sources/AppBundle/command/impl/ExecAndForgetCommand.swift index 7b2a076d..7a3de779 100644 --- a/Sources/AppBundle/command/impl/ExecAndForgetCommand.swift +++ b/Sources/AppBundle/command/impl/ExecAndForgetCommand.swift @@ -12,7 +12,6 @@ struct ExecAndForgetCommand: Command { process.environment = config.execConfig.envVariables process.executableURL = URL(filePath: "/bin/bash") process.arguments = ["-c", args.bashScript] - Result { try process.run() }.getOrThrow() - return true + return Result { try process.run() }.isSuccess } } diff --git a/Sources/Common/util/ResultEx.swift b/Sources/Common/util/ResultEx.swift index c608e272..929fb9c7 100644 --- a/Sources/Common/util/ResultEx.swift +++ b/Sources/Common/util/ResultEx.swift @@ -33,6 +33,13 @@ public extension Result { case .failure(let f): f } } + + var isSuccess: Bool { + switch self { + case .success: true + case .failure: false + } + } } public extension Result {