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

Unified Diff: utils/pub/validator/license.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/lib.dart ('k') | utils/pub/validator/name.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/validator/license.dart
diff --git a/utils/pub/validator/license.dart b/utils/pub/validator/license.dart
index 6cd623b643fd569ac89ee62e5a6f39fcc7da87eb..ffcbd10c9deb8b2e669348bfa659aa31ac2547f9 100644
--- a/utils/pub/validator/license.dart
+++ b/utils/pub/validator/license.dart
@@ -19,10 +19,14 @@ class LicenseValidator extends Validator {
: super(entrypoint);
Future validate() {
- return listDir(entrypoint.root.dir).then((files) {
+ return new Future.of(() {
var licenseLike = new RegExp(
r"^([a-zA-Z0-9]+[-_])?(LICENSE|COPYING)(\..*)?$");
- if (files.map(path.basename).any(licenseLike.hasMatch)) return;
+ if (listDir(entrypoint.root.dir)
+ .map(path.basename)
+ .any(licenseLike.hasMatch)) {
+ return;
+ }
errors.add(
"You must have a COPYING or LICENSE file in the root directory.\n"
« no previous file with comments | « utils/pub/validator/lib.dart ('k') | utils/pub/validator/name.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698