Add uv tool uninstall (#4641)

Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
This commit is contained in:
Zanie Blue 2024-06-29 13:50:20 -04:00 committed by GitHub
parent 8d9b4a5e1c
commit 7da3423af9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 239 additions and 5 deletions

View file

@ -143,6 +143,9 @@ impl InstalledTools {
Ok(())
}
/// Remove the environment for a tool.
///
/// Does not remove the tool's entrypoints.
pub fn remove_environment(&self, name: &str) -> Result<(), Error> {
let _lock = self.acquire_lock();
let environment_path = self.root.join(name);

View file

@ -25,8 +25,8 @@ pub struct Tool {
#[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub struct ToolEntrypoint {
name: String,
install_path: PathBuf,
pub name: String,
pub install_path: PathBuf,
}
/// Format an array so that each element is on its own line and has a trailing comma.
@ -105,6 +105,10 @@ impl Tool {
table
}
pub fn entrypoints(&self) -> &[ToolEntrypoint] {
&self.entrypoints
}
}
impl ToolEntrypoint {