ugexe / zef

Raku Module Management
Artistic License 2.0
207 stars 44 forks source link

[Feature Request] Simple method to remove old versions of modules #485

Open silentTeee opened 1 year ago

silentTeee commented 1 year ago

Could we offer a flag that could be used along with the upgrade command that allows for the automatic removal of older versions of the module candidates? Something like: zef upgrade --autoremove @*candidates

Right now if I want to upgrade everything, zef upgrade will simply install the newer module versions in addition to the older versions.

This should certainly continue to be the default behavior, as zef can't make assumptions about what sort of scripts the user system has written and what dependencies those scripts have. But for developers whose scripts have no hard ties to specific versions or who mainly do rapid development with a lot of libraries, they may not even realize that their module collection is growing quietly with each upgrade.

I imagine this is not a simple request (I can picture challenges relating to dependencies and version numbers not always being sequential or even existing on some older repositories, etc), but I think that a feature like this would be a significant Quality-of-Life improvement for the average user.