Commit 830b543c authored by Drew's avatar Drew

Try running shell via system.

NSTask is behaving strangely in some of my testing, it does not appear
to give us a PATH.  I wonder if this is related to
https://bugs.swift.org/browse/SR-566
parent 5a223d6f
Pipeline #740 failed with stage
......@@ -24,9 +24,7 @@ import atpkg
final class Shell : Tool {
func run(task: Task) {
guard let script = task["script"]?.string else { fatalError("Invalid 'script' argument to shell tool.") }
let t = NSTask.launchedTaskWithLaunchPath("/bin/sh", arguments: ["-c", script])
t.waitUntilExit()
if t.terminationStatus != 0 {
if system("/bin/sh -c \"\(script)\"") != 0 {
fatalError("/bin/sh -c \(script)")
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment