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

Cannot change existing environment variable #731

Open
mischajonker opened this issue Jan 21, 2025 · 3 comments
Open

Cannot change existing environment variable #731

mischajonker opened this issue Jan 21, 2025 · 3 comments

Comments

@mischajonker
Copy link

Once an environment variable already exists, we cannot override it anymore.

.env file:

TEST=foo

Script executed in runme.dev:

export TEST=bar
echo ${TEST}
export TEST_2=foo
export TEST_2=bar
echo ${TEST_2}

Expected result:

bar
bar

Actual result:

foo
bar

A similar situation happens when sourcing another script that sets environment variables. These environment variables can also not be overridden.

@jlewi
Copy link
Contributor

jlewi commented Jan 25, 2025

@mischajonker Is this the same issue as #653 ? That issue has a long discussion on environment variable behavior.

@mischajonker
Copy link
Author

Thank you @jlewi . Yes, it seems to be the same issue indeed.

It looks like the proposed shell option in #653 would solve it for my use case.

The current behavior with promptEnv=no is a bit counterintuitive (at least for me), because it only allows setting an environment variable once; I think a new switch is being proposed that would separate the prompt from the "do not allow updating environment variable" behavior, but I can't entirely parse what is being proposed in the ticket.

@sourishkrout
Copy link
Member

Please find the response/discussion here: #653 (comment)

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

No branches or pull requests

3 participants