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

Unified Diff: lib/src/executable.dart

Issue 1217923002: Fix a "pub run" bug. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Created 5 years, 6 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 | « no previous file | test/run/loads_package_imports_in_a_dependency_test.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 f692c026ecddec99dcd1767ca01d506080ddfc08..7e577d04256b5c2d9ef3d1856974182e557b5e16 100644
--- a/lib/src/executable.dart
+++ b/lib/src/executable.dart
@@ -110,6 +110,14 @@ Future<int> runExecutable(Entrypoint entrypoint, String package,
return exit_codes.NO_INPUT;
}
+ // If we're running an executable directly from the filesystem, make sure that
+ // it knows where to load the packages. If it's a dependency's executable, for
+ // example, it may not have the right packages directory itself.
+ if (executableUrl.scheme == 'file') {
+ // TODO(nweiz): use a .packages file once sdk#23369 is fixed.
+ vmArgs.add('--package-root=${p.toUri(entrypoint.packagesDir)}');
+ }
+
vmArgs.add(executableUrl.toString());
vmArgs.addAll(args);
« no previous file with comments | « no previous file | test/run/loads_package_imports_in_a_dependency_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698