Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(201)

Unified Diff: sdk/lib/_internal/pub/lib/src/command/list_package_dirs.dart

Issue 1165473002: Start pulling pub from its own repo. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Code review changes Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/command/lish.dart ('k') | sdk/lib/_internal/pub/lib/src/command/run.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/lib/src/command/list_package_dirs.dart
diff --git a/sdk/lib/_internal/pub/lib/src/command/list_package_dirs.dart b/sdk/lib/_internal/pub/lib/src/command/list_package_dirs.dart
deleted file mode 100644
index 9f6a1e2b00b1493ddbfb24feb86f4fb6d8331f3d..0000000000000000000000000000000000000000
--- a/sdk/lib/_internal/pub/lib/src/command/list_package_dirs.dart
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library pub.command.list_package_dirs;
-
-import 'dart:async';
-
-import 'package:path/path.dart' as path;
-
-import '../command.dart';
-import '../log.dart' as log;
-import '../utils.dart';
-
-/// Handles the `list-package-dirs` pub command.
-class ListPackageDirsCommand extends PubCommand {
- String get name => "list-package-dirs";
- String get description => "Print local paths to dependencies.";
- String get invocation => "pub list-package-dirs";
- bool get takesArguments => false;
- bool get hidden => true;
-
- ListPackageDirsCommand() {
- argParser.addOption("format",
- help: "How output should be displayed.",
- allowed: ["json"]);
- }
-
- Future run() {
- log.json.enabled = true;
-
- if (!entrypoint.lockFileExists) {
- dataError('Package "myapp" has no lockfile. Please run "pub get" first.');
- }
-
- var output = {};
-
- // Include the local paths to all locked packages.
- var packages = {};
- var futures = [];
- entrypoint.lockFile.packages.forEach((name, package) {
- var source = entrypoint.cache.sources[package.source];
- futures.add(source.getDirectory(package).then((packageDir) {
- packages[name] = path.join(packageDir, "lib");
- }));
- });
-
- output["packages"] = packages;
-
- // Include the self link.
- packages[entrypoint.root.name] = entrypoint.root.path("lib");
-
- // Include the file(s) which when modified will affect the results. For pub,
- // that's just the pubspec and lockfile.
- output["input_files"] = [
- entrypoint.lockFilePath,
- entrypoint.pubspecPath
- ];
-
- return Future.wait(futures).then((_) {
- log.json.message(output);
- });
- }
-}
-
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/command/lish.dart ('k') | sdk/lib/_internal/pub/lib/src/command/run.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698