output function
Runs an executable and returns its stdout, with trailing newlines removed.
Throws a ScriptException if the executable returns a non-zero exit code.
The executableAndArgs
and args
arguments are parsed as described in the
README. The name
is a human-readable identifier for this script that's
used in debugging and error reporting, and defaults to the executable name.
All other arguments are forwarded to Process.start.
See also Script.output.
Implementation
Future<String> output(String executableAndArgs,
{Iterable<String>? args,
String? name,
String? workingDirectory,
Map<String, String>? environment,
bool includeParentEnvironment = true,
bool runInShell = false}) =>
Script(executableAndArgs,
args: args,
name: name,
workingDirectory: workingDirectory,
environment: environment,
includeParentEnvironment: includeParentEnvironment,
runInShell: runInShell)
.output;