refactor(macos): centralize process pipe draining

This commit is contained in:
Peter Steinberger
2026-01-17 08:53:03 +00:00
parent 1002c74d9c
commit 869ef0c5ba
7 changed files with 20 additions and 24 deletions

View File

@@ -72,11 +72,11 @@ enum LaunchAgentManager {
let process = Process()
process.launchPath = "/bin/launchctl"
process.arguments = args
process.standardOutput = Pipe()
process.standardError = Pipe()
let pipe = Pipe()
process.standardOutput = pipe
process.standardError = pipe
do {
try process.run()
process.waitUntilExit()
_ = try process.runAndReadToEnd(from: pipe)
return process.terminationStatus
} catch {
return -1