ProcessTool class

A utility class designed to make it simple to create a DevTool that runs a process, waits for it to complete, and forwards its exit code.

To create a ProcessTool, all that is needed is an executable and args: import 'package:dart_dev/dart_dev.dart';

final config = {
  'github': ProcessTool(
    'open', ['https://github.com/Workiva/dart_dev']),
};

It is also possible to run this tool directly in a dart script: ProcessTool(exe, args).run();

Inheritance

Constructors

ProcessTool(String executable, List<String> args, {ProcessStartMode mode, String workingDirectory})

Properties

argParser ArgParser
The argument parser for this tool, if needed. [...]
read-only, inherited
description String
This tool's description (which is included in the help/usage output) can be overridden by setting this field to a non-null value.
read / write, inherited
hashCode int
The hash code for this object. [...]
read-only, inherited
hidden bool
This field determines whether or not this tool is hidden from the help/usage output when running as a part of a command-line app. [...]
read / write, inherited
process Process
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
run([DevToolExecutionContext context]) FutureOr<int>
Runs this tool and returns (either synchronously or asynchronously) an int which will be treated as the exit code (i.e. non-zero means failure). [...]
override
toCommand(String name) Command<int>
Converts this tool to a Command that can be added directly to a CommandRunner, therefore making it executable from the command-line. [...]
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) bool
The equality operator. [...]
inherited