runAsync static method

Future<String> runAsync(
  1. String package, {
  2. List<String>? arguments,
  3. RunOptions? runOptions,
  4. String? script,
})

Run pub run on the given package and script.

If script is null it defaults to the same value as package.

Implementation

static Future<String> runAsync(String package,
    {List<String>? arguments, RunOptions? runOptions, String? script}) {
  var scriptArg = script == null ? package : '$package:$script';
  final args = ['pub', 'run', scriptArg];
  if (arguments != null) args.addAll(arguments);
  return runlib.runAsync(sdkBin('dart'),
      arguments: args, runOptions: runOptions);
}