output function

Future<String> output(
  1. String executableAndArgs, {
  2. Iterable<String>? args,
  3. String? name,
  4. String? workingDirectory,
  5. Map<String, String>? environment,
  6. bool includeParentEnvironment = true,
  7. bool runInShell = false,
})

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;