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

Unified Diff: sdk/lib/_internal/pub_generated/lib/src/source/path.dart

Issue 887483002: Don't crash 'pub get' if a dev dependency is broken. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes Created 5 years, 11 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
Index: sdk/lib/_internal/pub_generated/lib/src/source/path.dart
diff --git a/sdk/lib/_internal/pub_generated/lib/src/source/path.dart b/sdk/lib/_internal/pub_generated/lib/src/source/path.dart
index dc1e8028b7b8a6599e2fa3031a233ef218838a8f..d6f7b8c0c70a9ce04e576216835edb1cc805533e 100644
--- a/sdk/lib/_internal/pub_generated/lib/src/source/path.dart
+++ b/sdk/lib/_internal/pub_generated/lib/src/source/path.dart
@@ -97,10 +97,14 @@ class PathSource extends Source {
// Resolve the path relative to the containing file path, and remember
// whether the original path was relative or absolute.
var isRelative = p.isRelative(description);
- if (p.isRelative(description)) {
- // Can't handle relative paths coming from pubspecs that are not on the
- // local file system.
- assert(containingPath != null);
+ if (isRelative) {
+ // Relative paths coming from pubspecs that are not on the local file
+ // system aren't allowed. This can happen if a hosted or git dependency
+ // has a path dependency.
+ if (containingPath == null) {
+ throw new FormatException(
+ '"$description" is a relative path, but this ' 'isn\'t a local pubspec.');
+ }
description = p.normalize(p.join(p.dirname(containingPath), description));
}

Powered by Google App Engine
This is Rietveld 408576698