anchor.diff:  Future<http.Response> _getResponse(String url) async => _client
       .get(url, headers: const {'User-Agent': 'dart.pkg.completion_metrics'});
   
  +bool _hasPubspec(FileSystemEntity f) =>
  +    f is Directory && File(path.join(f.path, 'pubspec.yaml')).existsSync();
  +
   Future<ProcessResult> _runPub(String dir) async =>
       await Process.run('flutter', ['pub', 'get'], workingDirectory: dir);
  +
  +Future<void> _runPubGet(FileSystemEntity dir) async {
  +  if (_hasPubspec(dir)) {
  +    final packageFile = path.join(dir.path, _package_config);
  +    if (!File(packageFile).existsSync() || forcePubUpdate) {
  +      print(
  +          'Updating pub dependencies for "${path.relative(dir.path, from: _appDir)}"...');
  +      final pubRun = await _runPub(dir.path);
  +      if (pubRun.exitCode != 0) {
  +        print('Error: ' + pubRun.stderr);
  +      }
  +    }
  +  }
  +}
   
   String _trimName(String name) {
     while (name.endsWith('/')) {
  
positive.code:     ? Platform.environment['LOCALAPPDATA']
      : Platform.environment['HOME'];
  
  Future<CloneResult> _clone(String repo) async {
    final name =
        _trimName(repo.split('https://github.com/').last.replaceAll('/', '_'));
    final cloneDir = path.join(_appDir, name);
    var result;
    if (Directory(cloneDir).existsSync()) {
      print('Repository "$name" exists -- pulling to update');
      result = await Process.run('git', ['pull'], workingDirectory: cloneDir);
    } else {
      print('Cloning $repo to $cloneDir');
      result = await Process.run('git', ['clone', '$repo.git', cloneDir]);
    }
    return CloneResult(result, cloneDir);
  }
  
  Future<String> _getBody(String url) async => (await _getResponse(url)).body;
  
negative.code:   }
  
    print('Cloning repositories...');
    if (!updateExistingClones) {
      print('(Skipping git updates.)');
    }
    for (var repo in repos) {
      final clone = await _clone(_trimName(repo));
      if (clone.exitCode != 0) {
        print('Error cloning $repo: ${clone.msg}');
      } else {
        await _runPub(clone.directory);
        if (recurseForDependencies) {
          for (var dir in Directory(clone.directory).listSync(recursive: true)) {
            await _runPubGet(dir);
          }
        }
      }
    }
  }
  
  /// Whether to force a pub get if a package config is found.
  final forcePubUpdate = false;
  
  /// Whether to recurse into projects when installing dependencies.
  final recurseForDependencies = true;
  
  /// Whether to update existing clones.
  final updateExistingClones = false;
  
  final _appDir =
      path.join(_homeDir, 'completion_metrics', 'third_party', 'apps');
  