From: Claudio Cambra Date: Wed, 19 Jun 2024 09:46:59 +0000 (+0800) Subject: Start working on mac builder script X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~6^2~175 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=e6d0f804652dbe6ff32f0da859f61c38abd6b6cb;p=nextcloud-desktop.git Start working on mac builder script Signed-off-by: Claudio Cambra --- diff --git a/admin/osx/craft-client.swift b/admin/osx/craft-client.swift new file mode 100644 index 000000000..43667a79f --- /dev/null +++ b/admin/osx/craft-client.swift @@ -0,0 +1,28 @@ +import Foundation + +@discardableResult +func run( + _ launchPath: String, + _ args: [String], + env: [String: String]? = nil, + quiet: Bool = false +) -> Int32 { + let task = Process() + task.launchPath = launchPath + task.arguments = args + + if let env, + let combinedEnv = task.environment?.merging(env, uniquingKeysWith: { (_, new) in new }) + { + task.environment = combinedEnv + } + + if quiet { + task.standardOutput = nil + task.standardError = nil + } + + task.launch() + task.waitUntilExit() + return task.terminationStatus +}