run method

  1. @override
void run()
override

Runs this command.

The return value is wrapped in a Future if necessary and returned by CommandRunner.runCommand.

Implementation

@override
void run() {
  if (argResults?.wasParsed('all') ?? false) {
    MelosHelper.run('melos run packages:upgrade');
    return;
  }
  var directory = 'gits_library';
  if (argResults?.wasParsed('dependency') ?? false) {
    directory = 'dependency_manager';
  }
  final path = join(current, 'core', 'packages', directory);
  if (!exists(path)) {
    StatusHelper.failed(
        'You don\'t have directory "$directory" in project, make sure to have "$directory" first');
  }
  FlutterHelper.start('packages upgrade', workingDirectory: path);
  FlutterHelper.start('packages get', workingDirectory: path);

  StatusHelper.success();
}