runCommand function
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;
}