Skip to content

Silently ignores variables from specified files when alreaady present in the environment #2

Description

@PeterJCLaw

For example:

$ dotenv-exec --no-default --file <(echo 'BEES=13') -- env | grep BEES
BEES=13

$ BEES=42 dotenv-exec --no-default --file <(echo 'BEES=13') -- env | grep BEES
BEES=42

I realise in this cut-down it's a bit more obvious what's going on, however if the parent environment value is truly from the environment and the file value is in a real file then it's much less clear.

It might be nice if dotenv-exec warned about such cases and/or offered a CLI flag to choose the desired behaviour -- especially as empty values are still preserved:

$ export BEES=42
$ BEES= dotenv-exec --no-default --file <(echo 'BEES=13') -- env | grep BEES
BEES=

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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