pubGetOrUpgrade function Null safety

Future<void> pubGetOrUpgrade(
  1. DependNode node
)

Implementation

Future<void> pubGetOrUpgrade(DependNode node) async {
  var run = command == 'upgrade' ? command : 'get';
  var path = node.path.replaceFirst(RegExp('/'), '');
  var args = ['pub', '$run', if (path.isNotEmpty) path];
  var res = await Process.run('flutter', args,
      workingDirectory: Directory.current.path, runInShell: true);
  if (null != res.stdout) print(res.stdout);
  if (null != res.stderr) print(res.stderr);
}