This commit is contained in:
leedongmyung 2023-11-12 20:08:30 +09:00
parent 5de28b7755
commit 69793a91f2

View file

@ -194,20 +194,14 @@ 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}, Result: ${cp949.decode(out)}\nError: ${cp949.decode(err)}');
'[ProcessExecutor] Exit Code: ${processResult!.exitCode}, Result: ${cp949.decodeString(processResult!.stdout)}\nError: ${cp949.decodeString(processResult!.stderr)}');
}
file.deleteSync();
c.complete(processResult);