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

Unified Diff: lib/src/global_packages.dart

Issue 1413713010: Fix error detection for a non-existent global script. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Fix test Created 5 years, 2 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/executable.dart ('k') | test/global/run/nonexistent_script_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/global_packages.dart
diff --git a/lib/src/global_packages.dart b/lib/src/global_packages.dart
index c58ed54c63749028f79ee2b2a24d59a97e9ae064..d3f0112b30896cb19b1c20a739bcc90fbdbe1ae6 100644
--- a/lib/src/global_packages.dart
+++ b/lib/src/global_packages.dart
@@ -123,7 +123,7 @@ class GlobalPackages {
/// Otherwise, the previous ones will be preserved.
Future activatePath(String path, List<String> executables,
{bool overwriteBinStubs}) async {
- var entrypoint = new Entrypoint(path, cache);
+ var entrypoint = new Entrypoint(path, cache, isGlobal: true);
// Get the package's dependencies.
await entrypoint.acquireDependencies(SolveType.GET);
@@ -172,7 +172,8 @@ class GlobalPackages {
// Load the package graph from [result] so we don't need to re-parse all
// the pubspecs.
- var entrypoint = new Entrypoint.fromSolveResult(root, cache, result);
+ var entrypoint = new Entrypoint.fromSolveResult(root, cache, result,
+ isGlobal: true);
var snapshots = await _precompileExecutables(entrypoint, dep.name);
_writeLockFile(dep.name, lockFile);
writeTextFile(_getPackagesFilePath(dep.name), lockFile.packagesFile());
@@ -312,14 +313,14 @@ class GlobalPackages {
// lockfile is the one we just loaded.
var dir = cache.sources[id.source].getDirectory(id);
var package = new Package.load(name, dir, cache.sources);
- return new Entrypoint.inMemory(package, lockFile, cache);
+ return new Entrypoint.inMemory(package, lockFile, cache, isGlobal: true);
}
// For uncached sources (i.e. path), the ID just points to the real
// directory for the package.
assert(id.source == "path");
- return new Entrypoint(PathSource.pathFromDescription(id.description),
- cache);
+ return new Entrypoint(
+ PathSource.pathFromDescription(id.description), cache, isGlobal: true);
}
/// Runs [package]'s [executable] with [args].
« no previous file with comments | « lib/src/executable.dart ('k') | test/global/run/nonexistent_script_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698