ProcessRunner class

Execute shell commands with retry logic

Constructors

ProcessRunner({int maxAutoRetries = 2, bool showVerbose = false, bool interactive = true})

Properties

hashCode → int
The hash code for this object.
no setterinherited
interactive → bool
Whether runWithRetry is allowed to prompt the user when automatic retries are exhausted. Set to false when running inside a spinner or other non-interactive UI so we never block waiting for stdin.
final
maxAutoRetries → int
Maximum automatic retries before prompting user
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
showVerbose → bool
Whether to show verbose output
final

Methods

commandExists(String command) → Future<bool>
Check if a command exists on the system
getCommandVersion(String command, {List<String> versionArgs = const <String>['--version']}) → Future<String?>
Get the version of a command
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
run(String executable, List<String> arguments, {String? workingDirectory, Map<String, String>? environment, bool inheritStdio = false}) → Future<ProcessResult>
Run a command and return the result
runStreaming(String executable, List<String> arguments, {String? workingDirectory, Map<String, String>? environment}) → Future<int>
Run a command and stream output in real-time
runWithRetry(String executable, List<String> arguments, {String? workingDirectory, Map<String, String>? environment, String? operationName, bool? interactive}) → Future<ProcessResult?>
Run a command with automatic retry on failure Returns null if user chooses to skip Throws AbortException if user chooses to abort
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited