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

Unified Diff: utils/pub/hosted_source.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/entrypoint.dart ('k') | utils/pub/io.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/hosted_source.dart
diff --git a/utils/pub/hosted_source.dart b/utils/pub/hosted_source.dart
index 4d6626f594d6f0f26878399b563ad89c48041d2f..7323ec5a4ff65f905f3c3ac21efbc6dcb9cef02d 100644
--- a/utils/pub/hosted_source.dart
+++ b/utils/pub/hosted_source.dart
@@ -118,17 +118,13 @@ class HostedSource extends Source {
return description;
}
- Future<List<Package>> getCachedPackages() {
- return defer(() {
- var cacheDir = path.join(systemCacheRoot,
- _getSourceDirectory(_defaultUrl));
- if (!dirExists(cacheDir)) return [];
-
- return listDir(path.join(cacheDir)).then((entries) {
- return entries.map((entry) =>
- new Package.load(null, entry, systemCache.sources));
- });
- });
+ List<Package> getCachedPackages() {
+ var cacheDir = path.join(systemCacheRoot,
+ _getSourceDirectory(_defaultUrl));
+ if (!dirExists(cacheDir)) return [];
+
+ return listDir(path.join(cacheDir)).map((entry) =>
+ new Package.load(null, entry, systemCache.sources));
}
/// When an error occurs trying to read something about [package] from [url],
« no previous file with comments | « utils/pub/entrypoint.dart ('k') | utils/pub/io.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698