-
Notifications
You must be signed in to change notification settings - Fork 503
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
A way to avoid calling a command with read dotenv variables #1203
Comments
Check out #953, which would make variable evaluation lazy, i.e. they would only be evaluated when used. Would that fix the problem? |
I think these are two different problems. And both are needed. 😄 |
Can you provide an example dotenv file, and example justfile? They should be as simple as possible, just to demonstrate the use-case and issue. I want to make sure I understand the use-case. |
Let's say I have a .env file like: THIS_IS_CHANGED_DURING_BUILD="123"
APP_URL="https://a" and a justfile like: set dotenv-load
build:
curl {{APP_URL}}
command that changes .env file here
npm run build The |
Gotcha. My hunch is that this isn't something that can be supported cleanly at the moment. I think the way to go for this is to implement #945, and then have two different .env files, like |
Oh. I do not like it very much. I think .env file needs to be just one. Can you think about this syntax instead? set dotenv-load
I_NEED_THIS
AND_THIS_ONE_ONLY |
Two alternative approaches:
This way it's a bit more explicit that you're re-consuming the changed env vars, otherwise there's some indirection in your commands and env vars. |
I think we need a way to avoid to execute a command with loaded environments variables from dotenv file.
Example: I use
set dotenv-load
in a justfile which will call later a command likenpm run build
. I need to have envs read in my justfile but not for that command because some of them are being modified a from justfile before it executes that command.The text was updated successfully, but these errors were encountered: