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

Unified Diff: sdk/lib/_internal/pub/lib/src/command/cache_list.dart

Issue 243683002: Refactor Source. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revise all the things. Created 6 years, 8 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
Index: sdk/lib/_internal/pub/lib/src/command/cache_list.dart
diff --git a/sdk/lib/_internal/pub/lib/src/command/cache_list.dart b/sdk/lib/_internal/pub/lib/src/command/cache_list.dart
index 18408e520c744ea155f1c3bbdcafd60de191c800..39d67e68b7466321c61530a2491644f1a4105c61 100644
--- a/sdk/lib/_internal/pub/lib/src/command/cache_list.dart
+++ b/sdk/lib/_internal/pub/lib/src/command/cache_list.dart
@@ -9,6 +9,7 @@ import 'dart:convert';
import '../command.dart';
import '../log.dart' as log;
+import '../source/cached.dart';
/// Handles the `cache list` pub command.
class CacheListCommand extends PubCommand {
@@ -21,7 +22,8 @@ class CacheListCommand extends PubCommand {
// TODO(keertip): Add flag to list packages from non default sources.
var packagesObj = <String, Map>{};
- for (var package in cache.sources.defaultSource.getCachedPackages()) {
+ var source = cache.sources.defaultSource as CachedSource;
+ for (var package in source.getCachedPackages()) {
var packageInfo = packagesObj.putIfAbsent(package.name, () => {});
packageInfo[package.version.toString()] = {'location': package.dir};
}
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/command/cache_add.dart ('k') | sdk/lib/_internal/pub/lib/src/command/cache_repair.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698