Fallback recipe doesn't work if --justfile leading to a sub dir provided
- Dominant language
- Rust
- Stars
- 35.8k
- Forks
- 846
- Avg merge
- 27m
- Merged PRs (30d)
- 3
Description
Hey!
I'm quite often using `--unstable` flag with the fallback recipe when working in nested structures.
Let's say that structure of my justfiles is:
```
repo/justfile
repo/project/justfile
```
While `repo/justfile` contains recipe `cleanup`, the `repo/project/justfile` doesn't. Thus, while being in the dir `repo` I wanted to run:
```
$ just --unstable --justfile project/justfile cleanup
just --unstable --justfile project/justfile cleanup
error: Justfile does not contain recipe `cleanup`.
Did you mean `clean`?
```
However, when I switched working directory to `repo/project` everything works:
```
$ cd project/
$ just --unstable cleanup
This is empty cleanup
# The same if I needlessly provide a justfile path
$ just --unstable --justfile justfile cleanup
This is empty cleanup
```
Contributor guide
Research direction
Reproduce the two command sequences from the issue, comparing a working-directory invocation with --justfile project/justfile from the repository root. Trace the CLI's fallback-recipe and justfile path handling; done means the latter invocation finds cleanup in the parent justfile as the working-directory case does.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100