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

Unified Diff: sdk/lib/_internal/pub/lib/src/global_packages.dart

Issue 496583002: Fix tests for pub global activate. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes Created 6 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 | « sdk/lib/_internal/pub/bin/pub.dart ('k') | sdk/lib/_internal/pub/lib/src/solver/backtracking_solver.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/global_packages.dart
diff --git a/sdk/lib/_internal/pub/lib/src/global_packages.dart b/sdk/lib/_internal/pub/lib/src/global_packages.dart
index 57f806a14af74b18b587438eab3041b827c7fc01..d762507354f30642062949cdae9e8ac54893b8e6 100644
--- a/sdk/lib/_internal/pub/lib/src/global_packages.dart
+++ b/sdk/lib/_internal/pub/lib/src/global_packages.dart
@@ -110,7 +110,13 @@ class GlobalPackages {
// Resolve it and download its dependencies.
return resolveVersions(SolveType.GET, cache.sources, root).then((result) {
- if (!result.succeeded) throw result.error;
+ if (!result.succeeded) {
+ // If the package specified by the user doesn't exist, we want to
+ // surface that as a [DataError] with the associated exit code.
+ if (result.error.package != dep.name) throw result.error;
+ if (result.error is NoVersionException) dataError(result.error.message);
+ throw result.error;
+ }
result.showReport(SolveType.GET);
// Make sure all of the dependencies are locally installed.
« no previous file with comments | « sdk/lib/_internal/pub/bin/pub.dart ('k') | sdk/lib/_internal/pub/lib/src/solver/backtracking_solver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698