Fix tryProcess on C#

This commit is contained in:
2023-02-11 15:42:56 -07:00
parent 688c9b8b71
commit 7e023d6167

View File

@@ -721,6 +721,7 @@ class Prelude {
#end #end
Sys.setCwd(cwd); Sys.setCwd(cwd);
} }
try {
var p = new Process(command, args); var p = new Process(command, args);
if (inputLines != null) { if (inputLines != null) {
for (line in inputLines) { for (line in inputLines) {
@@ -743,6 +744,10 @@ class Prelude {
Sys.setCwd(lastCwd); Sys.setCwd(lastCwd);
} }
return output; return output;
} catch (e) {
handleError('process $command $args failed: $e');
return "";
}
#elseif hxnodejs #elseif hxnodejs
var p = if (inputLines != null) { var p = if (inputLines != null) {
ChildProcess.spawnSync(command, args, {input: inputLines.join("\n"), cwd: cwd}); ChildProcess.spawnSync(command, args, {input: inputLines.join("\n"), cwd: cwd});