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

Unified Diff: sdk/lib/_internal/pub/lib/src/command_cache.dart

Issue 17167005: modify cache list command to show all versions of a package (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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 | « no previous file | sdk/lib/_internal/pub/test/pub_cache_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/lib/src/command_cache.dart
===================================================================
--- sdk/lib/_internal/pub/lib/src/command_cache.dart (revision 24187)
+++ sdk/lib/_internal/pub/lib/src/command_cache.dart (working copy)
@@ -33,11 +33,11 @@
// TODO(keertip): Add flag to list packages from non default sources
var packagesObj = <String, Map>{};
+
for (var package in cache.sources.defaultSource.getCachedPackages()) {
- packagesObj[package.name] = {
- 'version': package.version.toString(),
- 'location': package.dir
- };
+
nweiz 2013/06/19 22:14:55 Style nit: extra newline
+ var packageInfo = packagesObj.putIfAbsent(package.name, () => {});
+ packageInfo[package.version.toString()] = {'location': package.dir};
}
// TODO(keertip): Add support for non-JSON format
« no previous file with comments | « no previous file | sdk/lib/_internal/pub/test/pub_cache_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698