| Index: lib/src/command/list_package_dirs.dart
|
| diff --git a/lib/src/command/list_package_dirs.dart b/lib/src/command/list_package_dirs.dart
|
| index fe3627258846ab8e2ba1f6b2adc40edf4a9cff43..34d695273701d45ac1338937ec0d0b844c2216aa 100644
|
| --- a/lib/src/command/list_package_dirs.dart
|
| +++ b/lib/src/command/list_package_dirs.dart
|
| @@ -4,8 +4,6 @@
|
|
|
| library pub.command.list_package_dirs;
|
|
|
| -import 'dart:async';
|
| -
|
| import 'package:path/path.dart' as p;
|
|
|
| import '../command.dart';
|
| @@ -26,7 +24,7 @@ class ListPackageDirsCommand extends PubCommand {
|
| allowed: ["json"]);
|
| }
|
|
|
| - Future run() {
|
| + void run() {
|
| log.json.enabled = true;
|
|
|
| if (!entrypoint.lockFileExists) {
|
| @@ -36,23 +34,20 @@ class ListPackageDirsCommand extends PubCommand {
|
| var output = {};
|
|
|
| // Include the local paths to all locked packages.
|
| - var packages = {};
|
| - var futures = [];
|
| - entrypoint.lockFile.packages.forEach((name, package) {
|
| + var packages = mapMap(entrypoint.lockFile.packages, value: (name, package) {
|
| var source = entrypoint.cache.sources[package.source];
|
| - futures.add(source.getDirectory(package).then((packageDir) {
|
| - // Normalize paths and make them absolute for backwards compatibility
|
| - // with the protocol used by the analyzer.
|
| - packages[name] = p.normalize(p.absolute(p.join(packageDir, "lib")));
|
| - }));
|
| + var packageDir = source.getDirectory(package);
|
| + // Normalize paths and make them absolute for backwards compatibility
|
| + // with the protocol used by the analyzer.
|
| + return p.normalize(p.absolute(p.join(packageDir, "lib")));
|
| });
|
|
|
| - output["packages"] = packages;
|
| -
|
| // Include the self link.
|
| packages[entrypoint.root.name] =
|
| p.normalize(p.absolute(entrypoint.root.path("lib")));
|
|
|
| + output["packages"] = packages;
|
| +
|
| // Include the file(s) which when modified will affect the results. For pub,
|
| // that's just the pubspec and lockfile.
|
| output["input_files"] = [
|
| @@ -60,9 +55,7 @@ class ListPackageDirsCommand extends PubCommand {
|
| p.normalize(p.absolute(entrypoint.pubspecPath))
|
| ];
|
|
|
| - return Future.wait(futures).then((_) {
|
| - log.json.message(output);
|
| - });
|
| + log.json.message(output);
|
| }
|
| }
|
|
|
|
|