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

import and recipes order #1787

Closed
stessaris opened this issue Dec 28, 2023 · 1 comment
Closed

import and recipes order #1787

stessaris opened this issue Dec 28, 2023 · 1 comment

Comments

@stessaris
Copy link

The interaction between the import statement and the overriding of recipes doesn't seems intuitive to me, because imported recipes take the precedence over the ones in the importing file. I'd expect the other way around, in order to be able to override "defaults".

The following example shows the problem. With the two files:

# justfile

set allow-duplicate-recipes

import 'lib.just'

_default: hello
# lib.just

_default:
    @just --list

hello:
    echo "hello world"

I get the following:

$ just --version
just 1.19.0
$ just
error: Justfile contains no default recipe.
$ just _default
Available recipes:
    hello

While I'd expect that the default recipe exists, and should be the _default defined in ./justfile. If I move set allow-duplicate-recipes in ./lib.just, or move the _default definition before the import, I get the same results.

@casey
Copy link
Owner

casey commented Dec 29, 2023

Nice catch! I agree, recipes in parent modules should override recipes in imports. Fixed in #1790.

@casey casey closed this as completed Dec 29, 2023
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