This commit is contained in:
leedongmyung[desktop] 2023-11-25 12:48:14 +09:00
parent 7680ba8103
commit c1fcb69ea4

View file

@ -200,24 +200,18 @@ class ProcessExecutor {
print('Execute Bat: ${file.path} \n ${shell.toString()}');
file.createSync();
file.writeAsStringSync(shell.toString());
await Process.run('cmd', ['/C', file.path],
workingDirectory: workspace,
stdoutEncoding: Encoding.getByName('euc-kr'),
stderrEncoding: Encoding.getByName('euc-kr'))
await Process.run('cmd', ['/C', file.path], workingDirectory: workspace)
.then((ProcessResult result) {
processResult = result;
});
if (printStdout) {
Uint8List out = processResult!.stdout;
Uint8List err = processResult!.stderr;
print(
// ignore: prefer_interpolation_to_compose_strings
'[ProcessExecutor] Exit Code: ${processResult!.exitCode}\n' +
'==============================================================\n' +
'Result: ${eucKr.decode(out)}\n' +
'Result: ${eucKr.decode(processResult!.stdout)}\n' +
'==============================================================\n' +
'Error: ${eucKr.decode(err)}');
'Error: ${eucKr.decode(processResult!.stderr)}');
}
file.deleteSync();
c.complete(processResult);