-
Notifications
You must be signed in to change notification settings - Fork 500
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
Support Conditional Assignments #245
Comments
Thanks for opening this issue! Hmm, interesting. You can currently override assignments at the command line, so this would specifically be for conditional assignment to environment variables if that environment variable isn't already set? For example, this works:
Is there a use case where this isn't good enough? |
We often use # start the stack with defaults, e.g. MySQL on 3306
$ make
# customize the stack, because 3306 is used by something else
$ PROJ_MYSQL_PORT=3307 make |
You can do this currently, although you need to move the assignment after the command, so that it's processed by # start the stack with defaults, e.g. MySQL on 3306
$ just
# customize the stack, because 3306 is used by something else
$ just PROJ_MYSQL_PORT=3307 |
This is possible with That being said, the environment variable might come from a previous |
It sounds like you more want a way to import environment variables and use them in just expressions. |
That’s basically part of the idea, yeah. I want to use the environment variable if it is already defined and otherwise define it. There are a couple of things with which this feature could be extended. Like support for |
It's a bit longer, but you can now use something like |
Currently
just
allows us to assign values to variables, however, there is no way to conditionally assign like GNU Make has it. GNU Make uses the?=
for a conditional assignment, this seems like a reasonable syntax to me.Note that this feature is especially important for environment variables.
$ MY_ENV_VAR=bar just env echo bar bar
The text was updated successfully, but these errors were encountered: