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

Unified Diff: utils/pub/validator/lib.dart

Issue 13332009: Make listDir and createSymlink synchronous in pub. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes Created 7 years, 9 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 | « utils/pub/validator/directory.dart ('k') | utils/pub/validator/license.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/validator/lib.dart
diff --git a/utils/pub/validator/lib.dart b/utils/pub/validator/lib.dart
index c31b07101d36cc169b9e6d5b1bdf396bd78c9be6..7ff06fcab1dd3816622b044af56836cc641958a8 100644
--- a/utils/pub/validator/lib.dart
+++ b/utils/pub/validator/lib.dart
@@ -23,26 +23,26 @@ class LibValidator extends Validator {
: super(entrypoint);
Future validate() {
- var libDir = path.join(entrypoint.root.dir, "lib");
+ return new Future.of(() {
+ var libDir = path.join(entrypoint.root.dir, "lib");
- return defer(() {
if (!dirExists(libDir)) {
errors.add('You must have a "lib" directory.\n'
"Without that, users cannot import any code from your package.");
return;
}
- return listDir(libDir).then((files) {
- files = files.map((file) => path.relative(file, from: libDir)).toList();
- if (files.isEmpty) {
- errors.add('You must have a non-empty "lib" directory.\n'
- "Without that, users cannot import any code from your package.");
- } else if (files.length == 1 && files.first == "src") {
- errors.add('The "lib" directory must contain something other than '
- '"src".\n'
- "Otherwise, users cannot import any code from your package.");
- }
- });
+ var files = listDir(libDir)
+ .map((file) => path.relative(file, from: libDir))
+ .toList();
+ if (files.isEmpty) {
+ errors.add('You must have a non-empty "lib" directory.\n'
+ "Without that, users cannot import any code from your package.");
+ } else if (files.length == 1 && files.first == "src") {
+ errors.add('The "lib" directory must contain something other than '
+ '"src".\n'
+ "Otherwise, users cannot import any code from your package.");
+ }
});
}
}
« no previous file with comments | « utils/pub/validator/directory.dart ('k') | utils/pub/validator/license.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698