From 63fe1eae59fa81daeb43b38192ed3e0de4e04e15 Mon Sep 17 00:00:00 2001 From: Cole Miller Date: Thu, 23 Oct 2025 13:03:55 -0400 Subject: [PATCH] Fix overly noisy direnv error notification (#41029) Updates #40531, restoring the previous behavior which didn't surface an error when no direnv binary was found. Release Notes: - N/A --- crates/project/src/environment.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/project/src/environment.rs b/crates/project/src/environment.rs index 4dd1e94b9fce6bcf99e49402b8e5d05ece041f40..c04f1350aa7069267f9d8067e6ec765c4514f535 100644 --- a/crates/project/src/environment.rs +++ b/crates/project/src/environment.rs @@ -324,7 +324,9 @@ async fn load_direnv_environment( env: &HashMap, dir: &Path, ) -> anyhow::Result>> { - let direnv_path = which::which("direnv").context("finding direnv binary")?; + let Some(direnv_path) = which::which("direnv").ok() else { + return Ok(HashMap::default()); + }; let args = &["export", "json"]; let direnv_output = smol::process::Command::new(&direnv_path)