We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 83f03f9 + 95a0898 commit 116adc5Copy full SHA for 116adc5
Sources/run-script/main.swift
@@ -85,8 +85,10 @@ extension RunScript {
85
extension RunScript {
86
func run(_ script: Script) throws {
87
let process = Process()
88
+ let errorPipe = Pipe()
89
90
process.launchPath = script.launchPath ?? "/bin/sh"
91
+ process.standardError = errorPipe
92
93
if let path = script.path {
94
process.arguments = [path]
@@ -96,8 +98,12 @@ extension RunScript {
96
98
process.arguments = ["-c", script]
97
99
}
100
- process.launch()
- process.waitUntilExit()
101
+ try process.run()
102
+
103
+ let errorData = errorPipe.fileHandleForReading.readDataToEndOfFile()
104
+ if let error = String(data: errorData, encoding: .utf8) {
105
+ log("warning: [RunScriptPlugin] " + error)
106
+ }
107
108
109
0 commit comments