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
This commit is contained in:
Cole Miller
2025-10-23 17:03:55 +00:00
committed by GitHub
parent 8b6f3ec647
commit 63fe1eae59
+3 -1
View File
@@ -324,7 +324,9 @@ async fn load_direnv_environment(
env: &HashMap<String, String>,
dir: &Path,
) -> anyhow::Result<HashMap<String, Option<String>>> {
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)