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

feat(cli): Allow to override variable #12

Merged
merged 2 commits into from
Jun 22, 2024
Merged

feat(cli): Allow to override variable #12

merged 2 commits into from
Jun 22, 2024

Conversation

m-mizutani
Copy link
Owner

The PR allows to override environment variable by multiple -e option.

$ cat .env
POSTGRES_DB=your_local_db
POSTGRES_USER=test_user
$ cat .env.local
POSTGRES_DB=your_local_dev_db
$ zenv -e .env -e .env.local psql
# Access to your_local_dev_db with test_user

The priority for loading environment variables is as follows: first, the -e option, followed by additional -e options, and finally, the arguments of the zenv command.

$ cat .env1
COLOR=blue
$ cat .env2
COLOR=orange
$ zenv -e .env1 -e .env2 COLOR=red echo %COLOR
red

Copy link

octovy-dev bot commented Jun 22, 2024

🎉 No vulnerability detected 🎉

@m-mizutani m-mizutani merged commit c72b5cd into main Jun 22, 2024
6 checks passed
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 this pull request may close these issues.

1 participant