Index: utils/pub/package.dart |
diff --git a/utils/pub/package.dart b/utils/pub/package.dart |
index 8e96cbd243e699f5ca9401418ae5ee50d6c969b6..b7c2f9943a38659cedcb9c6f461ff85afdb4e9be 100644 |
--- a/utils/pub/package.dart |
+++ b/utils/pub/package.dart |
@@ -45,16 +45,17 @@ class Package { |
/// chosen. |
Future<String> get readmePath { |
return listDir(dir).then((entries) { |
- var readmes = entries.where((entry) => entry.contains(_README_REGEXP)); |
+ var readmes = entries.map(path.basename). |
+ where((entry) => entry.contains(_README_REGEXP)); |
if (readmes.isEmpty) return; |
- return readmes.min((readme1, readme2) { |
+ 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); |
- }); |
+ })); |
}); |
} |