Workaround C# Process behavior

This commit is contained in:
2023-02-18 11:35:44 -07:00
parent a40ce65af1
commit 2ba38b7d21

View File

@@ -728,18 +728,22 @@ class Prelude {
p.stdin.writeString('$line\n'); p.stdin.writeString('$line\n');
} }
} }
var output = if (fullProcess) { var output =
if (p.exitCode() == 0) { #if !cs
p.stdout.readAll().toString().trim(); if (fullProcess) {
} else { if (p.exitCode() == 0) {
handleError('process $command $args failed:\n${p.stdout.readAll().toString().trim() + p.stderr.readAll().toString().trim()}'); p.stdout.readAll().toString().trim();
return ""; } else {
} handleError('process $command $args failed:\n${p.stdout.readAll().toString().trim() + p.stderr.readAll().toString().trim()}');
} else { return "";
p.stdout.readLine().toString().trim(); }
} } else
#end
p.stdout.readLine().toString().trim();
#if !cs
p.kill(); p.kill();
p.close(); p.close();
#end
if (cwd != null) { if (cwd != null) {
Sys.setCwd(lastCwd); Sys.setCwd(lastCwd);
} }