process update

This commit is contained in:
leedongmyung 2025-01-02 20:05:19 +09:00
parent 609efc6b51
commit 6a99f29695

View file

@ -31,7 +31,8 @@ class ProcessData {
ProcessData(this._enableStdout, this._enableStderr,
{LogHandler? logHandler, Converter<List<int>, String>? decoder}) {
_logHandler = logHandler;
_decoder = decoder ?? utf8.decoder;
_decoder =
Platform.isWindows ? SystemEncoding().decoder : decoder ?? utf8.decoder;
}
bool get isSuccess {
@ -225,10 +226,10 @@ class ProcessExecutor {
await file.delete();
}
file.createSync();
file.writeAsStringSync(shell.toString());
file.writeAsStringSync(shell.toString(), flush: true);
try {
processData.process = await Process.start('cmd', ['/C', file.path],
workingDirectory: workspace, runInShell: false);
processData.process = await Process.start(
'powershell.exe', ['-NoProfile', '-File', file.absolute.path]);
} on Exception catch (e) {
logHandler ?? (e, LogType.error);
}