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

Unified Diff: lib/src/executable.dart

Issue 1282533003: Don't implicitly run "pub get". (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Code review changes Created 5 years, 4 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 | « lib/src/entrypoint.dart ('k') | lib/src/global_packages.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/executable.dart
diff --git a/lib/src/executable.dart b/lib/src/executable.dart
index 18dd9adc4b5774120e297a970528a0203460bd76..749277ff148e5121d06ded95b81147381aaa78cd 100644
--- a/lib/src/executable.dart
+++ b/lib/src/executable.dart
@@ -57,8 +57,7 @@ Future<int> runExecutable(Entrypoint entrypoint, String package,
if (entrypoint.root.name != package &&
!entrypoint.root.immediateDependencies
.any((dep) => dep.name == package)) {
- var graph = await entrypoint.loadPackageGraph();
- if (graph.packages.containsKey(package)) {
+ if (entrypoint.packageGraph.packages.containsKey(package)) {
dataError('Package "$package" is not an immediate dependency.\n'
'Cannot run executables in transitive dependencies.');
} else {
@@ -151,9 +150,8 @@ Future<Uri> _executableUrl(Entrypoint entrypoint, String package, String path,
// TODO(nweiz): Once sdk#23369 is fixed, allow global executables to be run
// (and snapshotted) from the filesystem using package specs. A spec can by
// saved when activating the package.
- var packageGraph = await entrypoint.loadPackageGraph();
- if (!isGlobal && !packageGraph.isPackageTransformed(package)) {
- var fullPath = packageGraph.packages[package].path(path);
+ if (!isGlobal && !entrypoint.packageGraph.isPackageTransformed(package)) {
+ var fullPath = entrypoint.packageGraph.packages[package].path(path);
if (!fileExists(fullPath)) return null;
return p.toUri(fullPath);
}
« no previous file with comments | « lib/src/entrypoint.dart ('k') | lib/src/global_packages.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698