run method

  1. @override
Future<List<ProcessResult>> run(
  1. String script, {
  2. ShellOnProcessCallback? onProcess,
})

Run one or multiple plain text command(s).

Commands can be splitted by line.

Commands can be on multiple line if ending with ^ or \. (note that \ must be escaped too so you might have to enter \\).

Returns a list of executed command line results.

onProcess is called for each started process.

Implementation

@override
Future<List<ProcessResult>> run(
  String script, {
  ShellOnProcessCallback? onProcess,
}) async {
  var results = await runScript(
    script,
    options: ShellCommandRunOptions(onProcess: onProcess),
  );
  return results.processResults;
}