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

Variables defined in a submodule should be overridable on the command line #2119

Open
lisongmin opened this issue Jun 1, 2024 · 2 comments

Comments

@lisongmin
Copy link

I have following justfile in the same directory:

var.just

compose_provider := 'podman'

test.just

import 'var.just'

show:
  @echo "compose_provider is {{ compose_provider }}"

Justfile

import 'var.just'
mod test 'test.just'

show:
  @echo "compose_provider is {{compose_provider}}"

And when i set the compose_provider from command line, the show recipe in the Justfile is changed as expect

❯ just --unstable compose_provider=nerdctl show
compose_provider is nerdctl

but the show recipe in the test module always show the default value

❯ just --unstable compose_provider=nerdctl test show
compose_provider is podman

The just version is 1.27.0

@casey casey changed the title Recipe in module doesn't pick the variable set from command line Variables defined in a submodule should be overridable on the command line Jun 1, 2024
@casey
Copy link
Owner

casey commented Jun 1, 2024

This is currently not possible. On the CLI, only variables in the root justfile can be overridden, but it would be nice to be able to override submodule variables.

@lisongmin
Copy link
Author

Thanks for the quick reply. And now I workaround by using the environment

compose_provider := env('COMPOSE_PROVIDER', 'podman')

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