Shell class Null safety

Multiplatform Shell utility to run a script with multiple commands.

Extra path/env can be loaded using ~/.config/tekartik/process_run/env.yaml

path: ~/bin

or

path:
  - ~/bin
  - ~/Android/Sdk/tools/bin
env:
  ANDROID_TOP: ~/Android
  FIREBASE_TOP: ~/.firebase

A list of ProcessResult is returned

Constructors

Shell({bool throwOnError = true, String? workingDirectory, Map<String, String>? environment, bool includeParentEnvironment = true, bool? runInShell, Encoding stdoutEncoding = systemEncoding, Encoding stderrEncoding = systemEncoding, Stream<List<int>>? stdin, StreamSink<List<int>>? stdout, StreamSink<List<int>>? stderr, bool verbose = true, bool? commandVerbose, bool? commentVerbose})
throwOnError means that if an exit code is not 0, it will throw an error [...]

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
path String
Get the shell path, using workingDirectory or current directory if null.
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

cd(String path) Shell
Create new shell at the given path
clone({bool? throwOnError, String? workingDirectory, Map<String, String>? environment, bool? includeParentEnvironment, bool? runInShell, Encoding? stdoutEncoding, Encoding? stderrEncoding, Stream<List<int>>? stdin, StreamSink<List<int>>? stdout, StreamSink<List<int>>? stderr, bool? verbose, bool? commandVerbose, bool? commentVerbose}) Shell
Create a new shell
kill([ProcessSignal signal = ProcessSignal.sigterm]) bool
Kills the current running process. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
popd() Shell
Pop the current directory to get the previous shell throw State error if nothing in the stack
pushd(String path) Shell
Create a new shell at the given path, allowing popd on it
run(String script, {void onProcess(Process process)?}) Future<List<ProcessResult>>
Run one or multiple plain text command(s). [...]
runExecutableArguments(String executable, List<String> arguments, {void onProcess(Process process)?}) Future<ProcessResult>
Run a single executable with arguments, resolving the executable if needed. [...]
toString() String
A string representation of this object. [...]
inherited

Operators

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