runCmd function

Future<RunCmdResult> runCmd(
  1. String cmd,
  2. List<String> args, [
  3. ExecOptions options = const ExecOptions()
])

Asynchronously run a command with the given arguments.

Spawns a process, captures stdout/stderr, and returns the result. Times out after options.timeoutMs if specified, throwing AppError with code 'COMMAND_FAILED'.

Implementation

Future<RunCmdResult> runCmd(
  String cmd,
  List<String> args, [
  ExecOptions options = const ExecOptions(),
]) {
  final executable = _normalizeExecutableCommand(cmd);
  return _runCmdAsync(executable, args, options, streaming: false);
}