From 0cd38464f155d6f1bab23d115302b517df4377f1 Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Thu, 18 Jul 2024 12:49:52 -0700 Subject: [PATCH] `set dotenv-path` does not override `set dotenv-filename` (#2262) --- tests/dotenv.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/dotenv.rs b/tests/dotenv.rs index 3c8df84172..08c4ed7a9e 100644 --- a/tests/dotenv.rs +++ b/tests/dotenv.rs @@ -394,3 +394,16 @@ fn dotenv_path_usable_from_subdir() { .stdout("dotenv-value\n") .run(); } + +#[test] +fn dotenv_path_does_not_override_dotenv_file() { + Test::new() + .write(".env", "KEY=ROOT") + .write( + "sub/justfile", + "set dotenv-path := '.'\n@foo:\n echo ${KEY}", + ) + .current_dir("sub") + .stdout("ROOT\n") + .run(); +}