mirror of
https://github.com/casey/just.git
synced 2025-12-23 11:37:29 +00:00
Only override root-justfile variable assignments (#2815)
This commit is contained in:
parent
d330ee31a6
commit
015bcdab7f
2 changed files with 30 additions and 2 deletions
|
|
@ -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(())
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue