From 7ea5c4472d9e60a990a170b7fa64915aec63a90a Mon Sep 17 00:00:00 2001 From: Noah Martin Date: Fri, 1 Mar 2024 15:50:53 -0500 Subject: [PATCH] Fix pipe --- ETTrace/Symbolicator/Utils.swift | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ETTrace/Symbolicator/Utils.swift b/ETTrace/Symbolicator/Utils.swift index 63babd6..3958af8 100644 --- a/ETTrace/Symbolicator/Utils.swift +++ b/ETTrace/Symbolicator/Utils.swift @@ -24,7 +24,6 @@ func processWithOutput(_ executable: String, args: [String]) throws -> String { let task = Process() let pipe = Pipe() - task.standardOutput = pipe task.arguments = args task.executableURL = URL(fileURLWithPath: executable) task.standardInput = nil @@ -35,7 +34,6 @@ func processWithOutput(_ executable: String, args: [String]) throws -> String { func safeShellWithOutput(_ command: String) throws -> String { let task = Process() - task.standardOutput = pipe task.arguments = ["--login", "-c", command] task.executableURL = URL(fileURLWithPath: "/bin/zsh") task.standardInput = nil @@ -45,6 +43,7 @@ func safeShellWithOutput(_ command: String) throws -> String { private func runTask(_ task: Process) throws -> String { let pipe = Pipe() + task.standardOutput = pipe let group = DispatchGroup() group.enter() var result = String()