runExecutableArgumentsSync function
ProcessResult
runExecutableArgumentsSync(
- String executable,
- List<
String> arguments, { - ShellOptions? options,
- String? workingDirectory,
- Map<
String, String> ? environment, - bool includeParentEnvironment = true,
- bool? runInShell,
- Encoding? stdoutEncoding = systemEncoding,
- Encoding? stderrEncoding = systemEncoding,
- StreamSink<
List< ? stdout,int> > - StreamSink<
List< ? stderr,int> > - bool? verbose,
- bool? commandVerbose,
- bool? throwOnError,
if commandVerbose or verbose is true, display the command.
if verbose is true, stream stdout & stdin
Does not throw by default if no options are given.
Compared to the async version, it is not possible to kill the spawn process nor to feed any input.
Implementation
ProcessResult runExecutableArgumentsSync(
String executable,
List<String> arguments, {
/// Prefer options
ShellOptions? options,
String? workingDirectory,
Map<String, String>? environment,
bool includeParentEnvironment = true,
bool? runInShell,
Encoding? stdoutEncoding = systemEncoding,
Encoding? stderrEncoding = systemEncoding,
StreamSink<List<int>>? stdout,
StreamSink<List<int>>? stderr,
bool? verbose,
bool? commandVerbose,
/// Compat default to false
bool? throwOnError,
}) {
throwOnError ??= false;
options ??= ShellOptions(
verbose: verbose ?? false,
commandVerbose: commandVerbose,
stderrEncoding: stderrEncoding,
stdoutEncoding: stdoutEncoding,
workingDirectory: workingDirectory,
stdout: stdout,
stderr: stderr,
environment: environment,
includeParentEnvironment: includeParentEnvironment,
runInShell: runInShell,
throwOnError: false,
);
var result = Shell(
options: options,
).runExecutableArgumentsSync(executable, arguments);
return result;
}