Chromium Code Reviews

Unified Diff: utils/pub/package.dart

Issue 13332009: Make listDir and createSymlink synchronous in pub. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: utils/pub/package.dart
diff --git a/utils/pub/package.dart b/utils/pub/package.dart
index 1bc7445869c2c1e4dcc8aa8f5a9db9cb56f8da19..d3d9819088ce9d30a76baab19871991b658034f0 100644
--- a/utils/pub/package.dart
+++ b/utils/pub/package.dart
@@ -43,20 +43,18 @@ class Package {
/// same conventions as pub.dartlang.org for choosing the primary one: the
/// README with the fewest extensions that is lexically ordered first is
/// chosen.
- Future<String> get readmePath {
- return listDir(dir).then((entries) {
- var readmes = entries.map(path.basename).
- where((entry) => entry.contains(_README_REGEXP));
- if (readmes.isEmpty) return;
-
- return path.join(dir, readmes.min((readme1, readme2) {
- var extensions1 = ".".allMatches(readme1).length;
- var extensions2 = ".".allMatches(readme2).length;
- var comparison = extensions1.compareTo(extensions2);
- if (comparison != 0) return comparison;
- return readme1.compareTo(readme2);
- }));
- });
+ String get readmePath {
+ var readmes = listDir(dir).map(path.basename).
+ where((entry) => entry.contains(_README_REGEXP));
+ if (readmes.isEmpty) return;
+
+ return path.join(dir, readmes.min((readme1, readme2) {
+ var extensions1 = ".".allMatches(readme1).length;
+ var extensions2 = ".".allMatches(readme2).length;
+ var comparison = extensions1.compareTo(extensions2);
+ if (comparison != 0) return comparison;
+ return readme1.compareTo(readme2);
+ }));
}
/// Loads the package whose root directory is [packageDir]. [name] is the

Powered by Google App Engine