dotenv support alters json values
- Dominant language
- Rust
- Stars
- 35.8k
- Forks
- 846
- Avg merge
- 27m
- Merged PRs (30d)
- 3
Description
just version 1.40.0 (on MacOS) strips some characters out of json values in the .env file.
Example:
.env:
```
VAR={"color":"red"}
```
Justfile:
```
set dotenv-load
default:
echo $VAR
```
Output:
```
echo $VAR
{color:red}
```
Output using `npx dotenv-cli -p VAR`:
```
{"color":"red"}
```
Note how just is stripping the quotes off the key and value.
I see that just is using dotenvy. Perhaps this bug is related: https://github.com/allan2/dotenvy/issues/84
Workaround:
Putting quotes around the value in the .env file, e.g.:
```
VAR='{"color":"red"}'
```
Contributor guide
Research direction
Start with the .env and Justfile example to reproduce dotenv loading on macOS, then inspect just's dotenvy integration and the referenced dotenvy issue. Done means JSON values such as {"color":"red"} retain their quotes when loaded without requiring extra quoting.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100