Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify Subcommand::run #2336

Merged
merged 11 commits into from
Sep 6, 2024
Merged

Simplify Subcommand::run #2336

merged 11 commits into from
Sep 6, 2024

Conversation

neunenak
Copy link
Contributor

@neunenak neunenak commented Sep 1, 2024

The Subcommand::run function is a bit messy because it needs to handle the case where fallback is enabled and a missing recipe triggers searching for a new justfile further up the directory tree. This commit attempts to simplify the loop within Subcommand::run and make the logic generally easier to understand.

@casey
Copy link
Owner

casey commented Sep 2, 2024

Won't this lead to double compiling the first justfile, since it's already compiled before we call run?

@neunenak
Copy link
Contributor Author

neunenak commented Sep 5, 2024

Won't this lead to double compiling the first justfile, since it's already compiled before we call run?

Whoops, yeah. Added a commit that fixes this.

@casey casey enabled auto-merge (squash) September 6, 2024 21:37
@casey
Copy link
Owner

casey commented Sep 6, 2024

Nice, this is a great simplification!

@casey casey merged commit da17424 into casey:master Sep 6, 2024
5 checks passed
@neunenak neunenak deleted the run-subcommand branch September 6, 2024 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants