Index: utils/pub/validator/name.dart |
diff --git a/utils/pub/validator/name.dart b/utils/pub/validator/name.dart |
index 7c4778c8af4604b849c9b16b4e9a4c6587d4a7c9..0386089c9821fa9c226cec98ed0338037159c4ba 100644 |
--- a/utils/pub/validator/name.dart |
+++ b/utils/pub/validator/name.dart |
@@ -10,6 +10,7 @@ import 'dart:io'; |
import '../../../pkg/path/lib/path.dart' as path; |
import '../entrypoint.dart'; |
import '../io.dart'; |
+import '../utils.dart'; |
import '../validator.dart'; |
/// Dart reserved words, from the Dart spec. |
@@ -47,8 +48,8 @@ class NameValidator extends Validator { |
/// to the package's root directory. |
Future<List<String>> get _libraries { |
var libDir = join(entrypoint.root.dir, "lib"); |
- return dirExists(libDir).then((libDirExists) { |
- if (!libDirExists) return []; |
+ return defer(() { |
+ if (!dirExists(libDir)) return []; |
return listDir(libDir, recursive: true); |
}).then((files) { |
return files |