shell_run library

Deprecated in 1.0.0. Prefer using shell in the future

Classes

ProcessCmd
Shell
Multiplatform Shell utility to run a script with multiple commands. [...]
ShellEnvironment
Shell modifiable helpers. should not be modified after being set.
ShellEnvironmentPaths
Shell environment ordered paths helper. Changes the PATH variable
ShellEnvironmentVars
Shell environment variables helper. Does not affect the PATH variable
ShellLinesController
Basic shell lines controller. [...]

Extensions

ProcessRunProcessExt
Process helper.
ProcessRunProcessResultsExt
run response helper.

Properties

dartChannel String
Current dart platform channel
read-only
dartExecutable String
Get dart vm either from executable or using the which command
read-only
dartVersion Version
Current dart platform version
read-only
isFlutterSupported bool
read-only
isFlutterSupportedSync bool
true if flutter is supported
read-only
platformEnvironment Map<String, String>
Environment without debug VM_OPTIONS and without any user overrides [...]
read-only
sharedStdIn SharedStdIn
A shared singleton instance of dart:io's stdin stream. [...]
final
shellEnvironment Map<String, String>
Cached shell environment with user config Same as userEnvironment
read / write
userAppDataPath String
Returns the user data path [...]
read-only
userEnvironment Map<String, String>
Get the user environment [...]
read-only
userHomePath String
Return the user home path. [...]
read-only
userPaths List<String>
Get the list of user paths used to resolve binaries location. [...]
read-only

Functions

getFlutterBinChannel() Future<String>
Get flutter channel. (dev, beta, master, stable) [...]
getFlutterBinVersion() Future<Version>
Get flutter version. [...]
processCmd(String executable, List<String> arguments, {String workingDirectory, Map<String, String> environment, bool includeParentEnvironment = true, bool runInShell, Encoding stdoutEncoding = systemEncoding, Encoding stderrEncoding = systemEncoding}) ProcessCmd
processCmdToDebugString(ProcessCmd cmd) String
processResultToDebugString(ProcessResult result) String
prompt(String text, {Stream<List<int>> stdin}) Future<String>
Get text
promptConfirm(String text, {Stream<List<int>> stdin}) Future<bool>
Confirm action
promptTerminate() Future
Terminate a prompt session.
run(String script, {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}) Future<List<ProcessResult>>
Run one or multiple plain text command(s). [...]
shellArgument(String argument) String
Use to safely enclose an argument if needed
shellArguments(List<String> argument) String
Convert multiple arguments to string than can be used in a terminal
shellExecutableArguments(String executable, List<String> arguments) String
Convert executable + arguments to a single script line
shellStreamLines(Stream<List<int>> stream, {Encoding encoding = systemEncoding}) Stream<String>
Basic line streaming. Assuming system encoding
userLoadEnv({Map<String, String> vars, List<String> paths, Map<String, String> aliases}) → void
Only specify the vars to override and the paths to add
userLoadEnvFile(String path) → void
Update userPaths and userEnvironment
which(String command, {Map<String, String> env, Map<String, String> environment, bool includeParentEnvironment = true}) Future<String>
whichSync(String command, {Map<String, String> env, Map<String, String> environment, bool includeParentEnvironment = true}) String
Find the command according to the paths or env variables (PATH)

Exceptions / Errors

ShellException
Exception thrown in exitCode != 0 and throwOnError is true