cmd_run library
Prefer using shell
Classes
- DartCmd
- Call dart executable
- FlutterCmd
- build a flutter command
- PbrCmd
- Run the build_runner command
- ProcessCmd
- Process command
- PubCmd
- pub
- PubGlobalRunCmd
- pub global run
- PubRunCmd
- pub run
- WebDevCmd
- webdev command
Constants
- dartChannelBeta → const String
- Beta channel.
- dartChannelDev → const String
- Dev channel.
- dartChannelMaster → const String
- Master channel.
- dartChannelStable → const String
- Stable channel.
Properties
- dartBinFileName ↔ String
-
dart bin file name
getter/setter pair
- dartChannel → String
-
Current dart platform channel
no setter
- dartExecutable → String?
-
Get dart vm either from executable or using the which command
no setter
- dartSdkBinDirPath → String
-
Get dart bin directory path
no setter
- dartSdkDirPath → String
-
Get dart sdk directory path
no setter
- dartVersion → Version
-
Current dart platform version
no setter
- flutterExecutablePath ↔ String?
-
Resolved flutter path if found
getter/setter pair
- isFlutterSupported → bool
-
true if flutter is supported
no setter
- isFlutterSupportedSync → bool
-
true if flutter is supported
no setter
Functions
-
argumentsToString(
List< String> arguments) → String - Convert multiple arguments to string than can be used in a terminal
-
argumentToString(
String argument) → String - Helper to run a process and connect the input/output for verbosity
-
devRunCmd(
ProcessCmd cmd, {bool? verbose, bool? commandVerbose, Stream< List< ? stdin, StreamSink<int> >List< ? stdout, StreamSink<int> >List< ? stderr}) → Future<int> >ProcessResult> - dev only run command
-
executableArgumentsToString(
String executable, List< String> ? arguments) → String - Convenient way to display a command
-
getDartBinVersion(
) → Future< Version?> - Parse flutter version
-
getFlutterBinChannel(
) → Future< String?> - Get flutter channel. (dev, beta, master, stable)
-
getFlutterBinVersion(
) → Future< Version?> - Get flutter version.
-
parsePlatformChannel(
String text) → String - Parse the text from Platform.version
-
parsePlatformVersion(
String text) → Version - Parse the text from Platform.version
-
processCmdToDebugString(
ProcessCmd cmd) → String - Process command debug string
-
processResultToDebugString(
ProcessResult result) → String - Process result debug string
-
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< ? stdin, StreamSink<int> >List< ? stdout, StreamSink<int> >List< ? stderr, bool verbose = true, bool? commandVerbose, bool? commentVerbose, ShellOptions? options, ShellOnProcessCallback? onProcess}) → Future<int> >List< ProcessResult> > - Run one or multiple plain text command(s).
-
runCmd(
ProcessCmd cmd, {bool? verbose, bool? commandVerbose, Stream< List< ? stdin, StreamSink<int> >List< ? stdout, StreamSink<int> >List< ? stderr}) → Future<int> >ProcessResult> - Command runner
-
runExecutableArguments(
String executable, List< String> arguments, {String? workingDirectory, Map<String, String> ? environment, bool includeParentEnvironment = true, bool? runInShell, Encoding? stdoutEncoding = systemEncoding, Encoding? stderrEncoding = systemEncoding, Stream<List< ? stdin, StreamSink<int> >List< ? stdout, StreamSink<int> >List< ? stderr, bool? verbose, bool? commandVerbose, bool? noStdoutResult, bool? noStderrResult, ShellOnProcessCallback? onProcess}) → Future<int> >ProcessResult> -
if
commandVerbose
orverbose
is true, display the command. ifverbose
is true, stream stdout & stdin