runPubGet method

void runPubGet(
  1. String? workingDirectory, {
  2. Progress? progress,
  3. bool? compileExecutables,
})

runs 'pub get'

Implementation

void runPubGet(String? workingDirectory,
    {Progress? progress, bool? compileExecutables}) {
  RunnableProcess process;
  if (useDartCommand) {
    if (pathToDartExe == null) {
      throw DCliException(
          "Unable to run 'dart pub get' as the dart exe is not on your path");
    }
    process = RunnableProcess.fromCommandArgs(
        pathToDartExe!, ['pub', 'get', '--no-precompile'],
        workingDirectory: workingDirectory);
  } else {
    if (pathToPubExe == null) {
      throw DCliException(
          "Unable to run ' pub get' as the pub exe is not on your path");
    }

    process = RunnableProcess.fromCommandArgs(
        pathToPubExe!, ['get', '--no-precompile'],
        workingDirectory: workingDirectory);
  }

  process
    ..start()
    ..processUntilExit(progress, nothrow: false);
  Settings().verbose('pub get finished');
}