runCommand function

Future<void> runCommand(
  1. String command,
  2. List<String> arguments, {
  3. String? workingDirectory,
})

Implementation

Future<void> runCommand(String command, List<String> arguments,
    {String? workingDirectory}) async {
  try {
    final result = await Process.run(command, arguments,
        workingDirectory: workingDirectory);
    if (result.exitCode != 0) {
      throw Exception(result.stderr);
    }
  } catch (e) {
    wtLog.error("Error running command: $command $arguments");
    rethrow;
  }
}