diff --git a/crates/uv-tool/src/lib.rs b/crates/uv-tool/src/lib.rs index 46caaabf6..65f88429a 100644 --- a/crates/uv-tool/src/lib.rs +++ b/crates/uv-tool/src/lib.rs @@ -75,7 +75,7 @@ impl InstalledTools { /// 3. A directory in the local data directory, e.g., `./.uv/tools` pub fn from_settings() -> Result { if let Some(tool_dir) = std::env::var_os(EnvVars::UV_TOOL_DIR) { - Ok(Self::from_path(tool_dir)) + Ok(Self::from_path(std::path::absolute(tool_dir)?)) } else { Ok(Self::from_path( StateStore::from_settings(None)?.bucket(StateBucket::Tools), diff --git a/crates/uv/src/commands/tool/uninstall.rs b/crates/uv/src/commands/tool/uninstall.rs index b25e2dea0..c9577adbc 100644 --- a/crates/uv/src/commands/tool/uninstall.rs +++ b/crates/uv/src/commands/tool/uninstall.rs @@ -38,9 +38,9 @@ pub(crate) async fn uninstall(name: Vec, printer: Printer) -> Resul fs_err::tokio::remove_dir_all(&installed_tools.root()) .await .ignore_currently_being_deleted()?; - if let Some(top_level) = installed_tools.root().parent() { - if uv_fs::directories(top_level).all(|path| uv_fs::is_temporary(&path)) { - fs_err::tokio::remove_dir_all(top_level) + if let Some(parent) = installed_tools.root().parent() { + if uv_fs::directories(parent).all(|path| uv_fs::is_temporary(&path)) { + fs_err::tokio::remove_dir_all(parent) .await .ignore_currently_being_deleted()?; }