process update
This commit is contained in:
parent
609efc6b51
commit
6a99f29695
1 changed files with 5 additions and 4 deletions
|
|
@ -31,7 +31,8 @@ class ProcessData {
|
||||||
ProcessData(this._enableStdout, this._enableStderr,
|
ProcessData(this._enableStdout, this._enableStderr,
|
||||||
{LogHandler? logHandler, Converter<List<int>, String>? decoder}) {
|
{LogHandler? logHandler, Converter<List<int>, String>? decoder}) {
|
||||||
_logHandler = logHandler;
|
_logHandler = logHandler;
|
||||||
_decoder = decoder ?? utf8.decoder;
|
_decoder =
|
||||||
|
Platform.isWindows ? SystemEncoding().decoder : decoder ?? utf8.decoder;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool get isSuccess {
|
bool get isSuccess {
|
||||||
|
|
@ -225,10 +226,10 @@ class ProcessExecutor {
|
||||||
await file.delete();
|
await file.delete();
|
||||||
}
|
}
|
||||||
file.createSync();
|
file.createSync();
|
||||||
file.writeAsStringSync(shell.toString());
|
file.writeAsStringSync(shell.toString(), flush: true);
|
||||||
try {
|
try {
|
||||||
processData.process = await Process.start('cmd', ['/C', file.path],
|
processData.process = await Process.start(
|
||||||
workingDirectory: workspace, runInShell: false);
|
'powershell.exe', ['-NoProfile', '-File', file.absolute.path]);
|
||||||
} on Exception catch (e) {
|
} on Exception catch (e) {
|
||||||
logHandler ?? (e, LogType.error);
|
logHandler ?? (e, LogType.error);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue