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 |