runProcessWithArguments static method

Future<int> runProcessWithArguments(
  1. String executable,
  2. List<String> arguments, {
  3. String? workingDirectory,
})

Runs executable with arguments (as a list, so spaces survive), sharing the terminal's stdio, and returns its exit code.

Implementation

static Future<int> runProcessWithArguments(
  String executable,
  List<String> arguments, {
  String? workingDirectory,
}) async {
  final process = await Process.start(
    executable,
    arguments,
    runInShell: true,
    workingDirectory: workingDirectory,
    mode: ProcessStartMode.inheritStdio,
  );

  return await process.exitCode;
}