Only override root-justfile variable assignments (#2815)

This commit is contained in:
Casey Rodarmor 2025-07-14 13:46:17 -07:00 committed by GitHub
parent d330ee31a6
commit 015bcdab7f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 30 additions and 2 deletions

View file

@ -86,7 +86,15 @@ impl<'src> Justfile<'src> {
scopes.get(&self.module_path).unwrap();
for module in self.modules.values() {
module.evaluate_assignments(arena, config, dotenv, overrides, root, scopes, search)?;
module.evaluate_assignments(
arena,
config,
dotenv,
&BTreeMap::new(),
root,
scopes,
search,
)?;
}
Ok(())

View file

@ -987,7 +987,7 @@ fn empty_doc_attribute_on_module() {
Test::new()
.write("foo.just", "")
.justfile(
r"
"
# Suppressed comment
[doc]
mod foo
@ -998,3 +998,23 @@ fn empty_doc_attribute_on_module() {
.stdout("Available recipes:\n foo ...\n")
.run();
}
#[test]
fn overrides_work_when_submodule_is_present() {
Test::new()
.write("bar.just", "")
.justfile(
"
mod bar
x := 'a'
foo:
@echo {{ x }}
",
)
.test_round_trip(false)
.arg("x=b")
.stdout("b\n")
.run();
}