Add new commands for removing cached JDKs#46
Conversation
The clear-cache command clears everything. But I often find myself wanting to remove "stale" versions of JDKs without starting from scratch. This commit adds two new commands for doing so: * cjdk rm - to target specifically named cached JDKs * cjdk prune - to remove older JDKs when newer ones are also cached Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
|
I was thinking of a |
|
Well... I sort of am using cjdk like a package manager now, in the sense that whenever possible, I try to install and use OpenJDKs managed by cjdk. I have built several shell commands around it, as shown here:
So I It all works great, but over time, I end up with "too many versions" installed, and I want to remove some redundant ones, but what is "redundant" is a judgment call—it doesn't always align with the But if this sort of usage isn't aligned with your vision for cjdk, I can just write another tool like |
The clear-cache command clears everything. But I often find myself wanting to remove "stale" versions of JDKs without starting from scratch. This commit adds two new commands for doing so:
cjdk rm- to target specifically named cached JDKscjdk prune- to remove older JDKs when newer ones are also cachedBecause both commands delete local files, both are gated behind confirmation prompts unless
-y/--yesis given, and the existingcjdk clear-cacheis also now gated as such to avoid someone naively deleting all their cached JDKs (which happened to me this morning 😅).I vibe-coded it with Claude, and also pushed it all as one commit. Apologies if that makes review more burdensome—although I have read through the entire patch and it looks clean and pretty minimal to me. The change of
def clear_cache(ctx: click.Context) -> Noneaddingdry_run: bool, yes: boolparameters without default values is, however, a breaking change.