.env-file support should have a flag to override pre-existing env-variables
- Dominant language
- Rust
- Stars
- 35.8k
- Forks
- 846
- Avg merge
- 27m
- Merged PRs (30d)
- 3
Description
I would love to see a setting to read .env-file to override/not-override pre-existing env-variables
e.g:
```
# load environment variables from .env file
set dotenv-filename := ".env"
set dotenv-load := true
set dotenv-enforce:= true # to enforce the values set in .env to override pre-existing env-variables
```
current options:
- dotenv-filename | string | - | Load a .env file with a custom name, if present.
- dotenv-load | boolean | false | Load a .env file, if present.
- dotenv-path | string | - | Load a .env file from a custom path and error if not present. Overrides dotenv-filename.
- dotenv-required | boolean | false | Error if a .env file isn’t found.
see also https://github.com/casey/just/issues/2597
Contributor guide
Research direction
Start by tracing the existing dotenv-filename, dotenv-load, dotenv-path, and dotenv-required settings and the .env loading path. Compare the requested override behavior with the discussion in issue 2597, then add coverage showing how pre-existing environment variables are handled and verify both override and non-override modes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100