venthur/dotenv-cli

Add option to replace environment instead of adding to it

Closed this issue · 1 comments

Current behavior is to add new environment variables and replace existing ones

    # update env
    env = os.environ.copy()
    env.update(dotenv)

I would like to have some flag to completely replace environemnt.

It would be useful to run build scripts, such as unreal engine build tools, which triggers full rebuild of all sources in case if any environment variable has changed.

And this might thake up to 3 hours.

Hi, thanks for the request. I've prepared a Pull Request (#87) with the feature enabled. You can call now dotenv --replace, and it will remove all existing variables.

Would you mind testing if it does the job for you?