Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to replace environment instead of adding to it #65

Closed
Mart-Bogdan opened this issue Dec 20, 2023 · 1 comment · Fixed by #87
Closed

Add option to replace environment instead of adding to it #65

Mart-Bogdan opened this issue Dec 20, 2023 · 1 comment · Fixed by #87

Comments

@Mart-Bogdan
Copy link

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.

@venthur
Copy link
Owner

venthur commented Mar 27, 2024

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?

@venthur venthur closed this as completed in 1b414ff Apr 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants