-
Notifications
You must be signed in to change notification settings - Fork 502
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
1748-dotenv-files #2022
base: master
Are you sure you want to change the base?
1748-dotenv-files #2022
Conversation
Dearest Reviewer, I was looking at the parser and the format for a list of things [] was already support for shells. I reused that concept to make an ordered list of strings. This now works ``` set dotenv-files := [".env1", ".env2"] ``` As does the command line ``` just --dotenv-files .env1 --dotenv-files .env2 echo ``` The new setting is applied last. It does not change how the other two settings currently work. I do have a problem I cant get this to work ``` ENV := "prod" set dotenv-files := [".env.{{ENV}}", ".env"] ``` it the `{{ENV}}` never turns in to prod. I am using parse_string_literal. the issue was updated about fallback justfiles. I have not used them and I would take any advice on what to change for that as well. Any advice would be appreciated Thanks Becker
Not very related to the PR, but to my knowledge, the ".env.{{ENV}}" is working as expected since interpolation only works in recipes. The alternative would be to write something like: ENV := "prod"
set dotenv-files := [".env."+ENV, ".env"] |
Does this need to be a separate setting? I strikes me that |
I made the new setting in response to the comment here #1748 (comment). Originally I had setting it more then once here #1940. I could redo dotenv-file take a string or list with the current dotenv-file and accept the command line multiple times. Kind of munging the two PRs together. The parse_ordered_list i wrote only works with static strings. I have not figured out how to get an expression working ie: |
I think having a single setting that takes an array is a better idea. Otherwise, the two settings conflict.
It will have to take a static string. dotenv file settings are applied before anything in the justfile is evaluated, so it can't use variables. I did merge #2055 recently, which adds a new kind of string literal which can contain environment variables, so those can be used. |
Also, this needs tests, including tests which cover how different ways dotenv files can be specified interact with each other. |
Converting to a draft so I can keep track of what's ready to go. Feel free to undraft when it's ready! |
Dearest Reviewer,
I was looking at the parser and the format for a list of things [] was already support for shells. I reused that concept to make an ordered list of strings.
This now works
As does the command line
The new setting is applied last. It does not change how the other two settings currently work.
I do have a problem I cant get this to work
it the
{{ENV}}
never turns in to prod. I am using parse_string_literal.the issue #1748 asked about fallback justfiles. I have not used them and I would take any advice on what to change for that as well.
Any advice would be appreciated
Thanks
Becker