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

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: 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/io.dart ('k') | utils/pub/path_source.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « utils/pub/io.dart ('k') | utils/pub/path_source.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698