Skip to content

Commit

Permalink
Allow fallback with recipes in submodules (#2329)
Browse files Browse the repository at this point in the history
  • Loading branch information
casey authored Aug 28, 2024
1 parent 10ebaec commit d3d3c4e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/subcommand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ impl Subcommand {
};

match Self::run_inner(config, loader, arguments, overrides, &search) {
Err((err @ Error::UnknownRecipe { .. }, true)) => {
Err((err @ (Error::UnknownRecipe { .. } | Error::UnknownSubmodule { .. }), true)) => {
match search.justfile.parent().unwrap().parent() {
Some(parent) => {
unknown_recipes_errors.get_or_insert(err);
Expand Down
12 changes: 12 additions & 0 deletions tests/fallback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,3 +362,15 @@ fn stop_fallback_when_fallback_is_false() {
.status(EXIT_FAILURE)
.run();
}

#[test]
fn works_with_modules() {
Test::new()
.write("bar/justfile", "set fallback := true")
.write("foo.just", "baz:\n @echo BAZ")
.justfile("mod foo")
.args(["foo::baz"])
.current_dir("bar")
.stdout("BAZ\n")
.run();
}

0 comments on commit d3d3c4e

Please sign in to comment.