LPGhatguy / aftman

Aftman, the prodigal sequel to Foreman
MIT License
162 stars 19 forks source link

How do we uninstall tools? #22

Open ok-nick opened 2 years ago

ok-nick commented 2 years ago

The readme states you could uninstall tools, yet there is no option to do so? Is it done implicitly? Has the explicit command not been implemented yet?

LPGhatguy commented 2 years ago

This is a good question.

I wonder if we can get away with just aftman uninstall foo or aftman remove foo that removes a tool from your nearest manifest and... maybe deletes the binary?

One of the issues with removing tools is that we don't really know if another manifest file on your computer might be referencing that tool. You might want it to stick around.

This is something we should think about carefully.

LastTalon commented 2 years ago

At the very least I think an aftman uninstall command that strictly uninstalls a tool from the system regardless of any manifest would be useful.

Say you're contributing to a project, so you pull down the project to your system and it has an aftman manifest for tooling. You check the tools its going to install and initially believe you trust them, so you install them. Later, for whatever reason you decide you no longer trust them, so you wish to remove them from your system entirely. So, removal from the system and trusted tools should be supported in this case at least.

ok-nick commented 2 years ago

aftman uninstall x

Uninstalls if there is only one version or prompts a confirmation to uninstall all versions.

aftman uninstall x@1.0.0

Uninstalls a specific version.

aftman uninstall x --all

Forcefully uninstalls all versions.

aftman uninstall x --local

Uninstalls version from local manifest file.

aftman uninstall x --remove

This will remove it from the local manifest and uninstall it. There is really no way to confirm if that tool version is being cross-referenced by another project, so it probably makes the most sense to allow the user to choose. I don't know how I feel about --remove, it isn't too descriptive.

ok-nick commented 2 years ago

Perhaps it also makes sense to add a command like this:

aftman uninstall x --distrust

Should be self-explanatory, but it removes the tool from the list of trusted tools. Should this work only if all versions are uninstalled?

LPGhatguy commented 2 years ago

I think we could start with just aftman uninstall x and aftman uninstall x/y as a first pass for this feature. If given a tool alias, we'll uninstall that tool if it's known, otherwise uninstall a specific tool name.