From cac6560b4ff5909e118053fe83186c691003be05 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Thu, 17 Apr 2025 11:36:05 -0500 Subject: [PATCH] Treat empty `UV_TOOL_DIR` as unset (#12905) Closes https://github.com/astral-sh/uv/issues/8608 --- crates/uv-tool/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/uv-tool/src/lib.rs b/crates/uv-tool/src/lib.rs index 70aeaf32a..fbaca618e 100644 --- a/crates/uv-tool/src/lib.rs +++ b/crates/uv-tool/src/lib.rs @@ -74,7 +74,7 @@ impl InstalledTools { /// 2. A directory in the system-appropriate user-level data directory, e.g., `~/.local/uv/tools` /// 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) { + if let Some(tool_dir) = std::env::var_os(EnvVars::UV_TOOL_DIR).filter(|s| !s.is_empty()) { Ok(Self::from_path(std::path::absolute(tool_dir)?)) } else { Ok(Self::from_path(