-
Notifications
You must be signed in to change notification settings - Fork 233
new command pub cache gc
#4684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
new command pub cache gc
#4684
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
parts[parts.length - 1] == 'package_config.json') { | ||
projectDir = p.joinAll(parts.sublist(0, parts.length - 2)); | ||
} | ||
log.message('* $projectDir'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe restrict the number of outputs here?
/// successfully repaired. | ||
Future<Iterable<RepairResult>> repairCachedPackages(SystemCache cache); | ||
|
||
/// Return all files directories inside this source that can be removed while |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Return all files directories inside this source that can be removed while | |
/// Return all directories inside this source that can be removed while |
}); | ||
}); | ||
|
||
test('gcing and empty cache behaves well', () async { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test('gcing and empty cache behaves well', () async { | |
test('gcing an empty cache behaves well', () async { |
To recover space occupied by unused old dependencies in the pub cache, without affecting "active" projects.
Will enumerate all package configs from all active projects to find all the packages located within the pub cache.
Then enumerates all packages/git repos in the pub cache, and removes those that are not referred to by the active projects.
Active projects have been marked since dart 3.9.0.