mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-03 18:38:21 +00:00
Avoid error on relative paths in uv tool uninstall
(#11889)
## Summary Closes https://github.com/astral-sh/uv/issues/11877.
This commit is contained in:
parent
8dd079f2ad
commit
cf76334d79
2 changed files with 4 additions and 4 deletions
|
@ -75,7 +75,7 @@ impl InstalledTools {
|
|||
/// 3. A directory in the local data directory, e.g., `./.uv/tools`
|
||||
pub fn from_settings() -> Result<Self, Error> {
|
||||
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),
|
||||
|
|
|
@ -38,9 +38,9 @@ pub(crate) async fn uninstall(name: Vec<PackageName>, 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()?;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue