Skip to content

Commit a7a0d4c

Browse files
committed
Fix Result output
1 parent 899800c commit a7a0d4c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: Sources/ScriptingHelpers/ScriptingHelpers.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ public func shell(_ command: String) -> Result<String, String> {
2020

2121
let outputData = outputPipe.fileHandleForReading.readDataToEndOfFile()
2222
let errorData = errorPipe.fileHandleForReading.readDataToEndOfFile()
23-
if let output = String(data: outputData, encoding: .utf8) {
23+
if let output = String(data: outputData, encoding: .utf8), !output.isEmpty {
2424
return .success(output)
25-
} else if let error = String(data: errorData, encoding: .utf8) {
25+
} else if let error = String(data: errorData, encoding: .utf8), !error.isEmpty {
2626
return .failure(error)
2727
}
2828

0 commit comments

Comments
 (0)