checkDependencies function

void checkDependencies (
  1. List<String> args
)

Checks your pubspec.yaml dependencies with pub to see if there are newer versions available You can optionally specify the location of your pubspec.yaml with the -p flag You can optionally specify the location of your pubspec.lock with the -l flag

Implementation

void checkDependencies(final List<String> args) async {
  try {
    final cliArgs = CLIArgParser.fromRawArgs(args);
    final FileContents fileContents =
        await FileHelper.readFileContents(cliArgs);
    final List<ResolvedDependency> latestVersions =
        await PubService.lastVersions(
            fileContents.yamlContents.allDependencies);

    final output = Comparator.compareVersions(
      CompareInput(
        fileContents.yamlContents.allDependencies,
        fileContents.lockContents.resolvedDependencies,
        latestVersions,
      ),
    );

    Printer.printOutput(output);
    exit(0);
  } catch (e) {
    stderr.writeln(e);
    CLIArgParser.printUsage();
    exit(1);
  }
}