Skip to content

Commit 5732e35

Browse files
authored
Merge pull request #17 from p-x9/version/0.3.0
Version 0.3.0
2 parents 83f03f9 + 45741ea commit 5732e35

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ let package = Package(
3232
),
3333
.binaryTarget(
3434
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"
3737
),
3838
// DEBUG
3939
// .binaryTarget(name: "run-script-bin", path: "./run-script-bin.artifactbundle.zip"),

Sources/run-script/main.swift

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,10 @@ extension RunScript {
8585
extension RunScript {
8686
func run(_ script: Script) throws {
8787
let process = Process()
88+
let errorPipe = Pipe()
8889

8990
process.launchPath = script.launchPath ?? "/bin/sh"
91+
process.standardError = errorPipe
9092

9193
if let path = script.path {
9294
process.arguments = [path]
@@ -96,8 +98,12 @@ extension RunScript {
9698
process.arguments = ["-c", script]
9799
}
98100

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+
}
101107
}
102108
}
103109

0 commit comments

Comments
 (0)