File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -32,8 +32,8 @@ let package = Package(
32
32
) ,
33
33
. binaryTarget(
34
34
name: " run-script-bin " ,
35
- url: " https://github.com/p-x9/RunScriptPlugin/releases/download/0.1 .0/run-script-bin.artifactbundle.zip " ,
36
- checksum: " d5e984321b277ca3228f2d1d2e4eb0f84f6ff53e05d0516a0640838aa60e32c5 "
35
+ url: " https://github.com/p-x9/RunScriptPlugin/releases/download/0.3 .0/run-script-bin.artifactbundle.zip " ,
36
+ checksum: " 3e43154c72e5d7bdadbe000cd23f78cbcf8f200149ea28a969539c22ef7be524 "
37
37
) ,
38
38
// DEBUG
39
39
// .binaryTarget(name: "run-script-bin", path: "./run-script-bin.artifactbundle.zip"),
Original file line number Diff line number Diff line change @@ -85,8 +85,10 @@ extension RunScript {
85
85
extension RunScript {
86
86
func run( _ script: Script ) throws {
87
87
let process = Process ( )
88
+ let errorPipe = Pipe ( )
88
89
89
90
process. launchPath = script. launchPath ?? " /bin/sh "
91
+ process. standardError = errorPipe
90
92
91
93
if let path = script. path {
92
94
process. arguments = [ path]
@@ -96,8 +98,12 @@ extension RunScript {
96
98
process. arguments = [ " -c " , script]
97
99
}
98
100
99
- process. launch ( )
100
- 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
+ }
101
107
}
102
108
}
103
109
You can’t perform that action at this time.
0 commit comments