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

Unified Diff: utils/pub/entrypoint.dart

Issue 10896051: Improve the error message for pub install without a name key in the pubspec. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 | « no previous file | utils/tests/pub/pub_install_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/entrypoint.dart
diff --git a/utils/pub/entrypoint.dart b/utils/pub/entrypoint.dart
index 2758707385ebd577c65b46c00a9819d6009fb562..02a2359414f08d39bbf13c462fa0860ec890688b 100644
--- a/utils/pub/entrypoint.dart
+++ b/utils/pub/entrypoint.dart
@@ -233,16 +233,17 @@ class Entrypoint {
Future _validatePubspec() {
var future = new Future.immediate(null);;
if (root.pubspec.isEmpty) {
- future = exists(join(path, "pubspec.yaml")).transform((exists) {
+ future = exists(join(root.dir, "pubspec.yaml")).transform((exists) {
if (exists) return;
- throw 'Could not find a file named "pubspec.yaml" in the directory'
+ throw 'Could not find a file named "pubspec.yaml" in the directory '
'$path.';
});
}
return future.transform((_) {
if (root.pubspec.name != null) return;
- throw '"pubspec.yaml" must contain a "name" key.';
+ throw '"pubspec.yaml" is missing the required "name" field (e.g. "name: '
+ '${root.name}").';
});
}
}
« no previous file with comments | « no previous file | utils/tests/pub/pub_install_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698