casey / casey/just

.env-file support should have a flag to override pre-existing env-variables

Open
#2,613 1 comment 2 reactions 0 assignees View on GitHub
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.