Skip to content

Conversation

CompeyDev
Copy link
Contributor

@CompeyDev CompeyDev commented Aug 17, 2024

Adds a rokit remove command to remove installed tools, which works similar to rokit add.

Closes #3.

* Added `RokitManifest::remove_tool` to remove a tool from the manifests
* Added `ToolStorage::remove_tool_link` to remove a link for an
  installed tool
@CompeyDev CompeyDev changed the title feat: include tooling removal methods Include tooling removal methods Aug 21, 2024
Copy link
Collaborator

@filiptibell filiptibell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Went through the code and it looks good overall, and it looks like this is mostly copied from the add command, so I just left a few nits.
However, the reason the remove command was not implemented before Rokit's release is because there were some additional things to consider. They all stem from the fact that Rokit does not and can not know about all rokit.toml files on the system.

  1. Should the remove command only remove tools from the single manifest, similar to add? If so, how do we communicate to a user that the tool may still exist on their system, just not in the chosen manifest?
  2. If the command should remove tool binaries, which ones does it remove?
    • All of them, requiring a reinstall in Rokit projects that may still be using the tool
    • Only the one listed in the manifest, leaving remaining binaries, but the exact tool may still need a reinstall in other Rokit projects
  3. If the command should remove tool links, how do we make sure this is actually correct? A user can have a tool such as rojo = "Kampfkarren/[email protected]" if they so desire, and this would actually need the rojo link to still exist.

I dont have a good answer to these questions but it seems to me like #70 considered it to some extent (it removed the link only when all tool binaries were gone).
Maybe it would be good to have some combination of a remove + uninstall subcommand, where uninstall nukes the binaries while remove only deals with manifests.

@@ -1,5 +1,6 @@
use anyhow::{Context, Result};
use clap::{ArgAction, CommandFactory, Parser};
use remove::RemoveSubcommand;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this was an auto import, so rust-analyzer put it up here, but all the imports for commands are grouped below so the new import should be there as well.

@ActualMasterOogway
Copy link
Contributor

@filiptibell any plans on reviewing this PR again?

@CompeyDev
Copy link
Contributor Author

@filiptibell any plans on reviewing this PR again?

I haven't yet addressed all the comments on this PR, and I do not think I will be able to anytime soon.

The feature is pretty simple to implement, and I have enabled maintainer commits, so @filiptibell should be able to finalize and merge it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a command for uninstalling a tool/all of them

3 participants