casey / casey/just

Fallback recipe doesn't work if --justfile leading to a sub dir provided

Open
#1,286 8 comments 2 reactions 0 assignees View on GitHub
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.