Skip to content

dotenv support alters json values #2730

@ansel1

Description

@ansel1

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: allan2/dotenvy#84

Workaround:
Putting quotes around the value in the .env file, e.g.:

VAR='{"color":"red"}'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions