run method
Future<CommandResult>
run(
- String command, {
- List<
String> arguments = const [], - String? workingDirectory,
- Duration? timeout,
- CommandPriority priority = CommandPriority.normal,
override
Runs command with arguments and returns stdout/stderr/exit code.
When timeout elapses the process is killed and a TimeoutException
is thrown. priority orders work on the isolate executor; mark
idempotent polling queries CommandPriority.background.
Implementation
@override
Future<CommandResult> run(
String command, {
List<String> arguments = const [],
String? workingDirectory,
Duration? timeout,
CommandPriority priority = CommandPriority.normal,
}) async {
calls.add(
FakeCommandCall(
command: command,
arguments: List.unmodifiable(arguments),
workingDirectory: workingDirectory,
timeout: timeout,
priority: priority,
),
);
return handler(command, arguments) ??
const CommandResult(stdout: '', stderr: '', exitCode: 1);
}