runCommand function

Future<int> runCommand(
  1. String executable,
  2. List<String> args, {
  3. String? workingDirectory,
  4. bool silent = false,
})

Runs a shell command and streams output. Returns the exit code.

Implementation

Future<int> runCommand(
  String executable,
  List<String> args, {
  String? workingDirectory,
  bool silent = false,
}) async {
  final process = await Process.start(
    executable,
    args,
    workingDirectory: workingDirectory,
    mode: silent ? ProcessStartMode.normal : ProcessStartMode.inheritStdio,
  );

  return process.exitCode;
}