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

Default recipe assigned to recipe within include directive #1669

Closed
mmstick opened this issue Sep 8, 2023 · 3 comments
Closed

Default recipe assigned to recipe within include directive #1669

mmstick opened this issue Sep 8, 2023 · 3 comments

Comments

@mmstick
Copy link

mmstick commented Sep 8, 2023

Problem

!include /usr/share/justfiles/cosmic-app.just

default: build-release

As above, I'd like to be able to !include common recipes for packaging applications. However, due to how the default recipe is defined by a FIFO basis, and where I'm finding that there isn't a good way to define a default recipe if any of the includes contain recipes. The end user gets unhelpful error messages about internally-defined recipes requiring arguments. Or you must preemptively define an include with a default recipe.

Possible solutions

One of these would solve the issue

  • Allow defining recipes before include directives
  • Ignore recipes from include directives when choosing a default recipe
  • Opt out of FIFO-based selection with a default recipe attribute
  • Opt out of FIFO-based selection with a recipe named default
  • Opt out of FIFO-based selection with a default-recipe variable
@casey
Copy link
Owner

casey commented Nov 21, 2023

We just merged #1618, which allows !include to be used anywhere in a justfile, so you can now do:

default: build-release

!include foo.just

@casey casey closed this as completed Nov 21, 2023
@mmstick
Copy link
Author

mmstick commented Nov 21, 2023

Thanks!

@casey
Copy link
Owner

casey commented Nov 21, 2023

You bet! Keep in mind that although the example I gave works, the actual behavior is quite odd, to say the least. See #1736 for details.

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

No branches or pull requests

2 participants