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

command line option -e is ignored when GO_ENV is defined in .env file #269

Closed
armhold opened this issue Oct 14, 2018 · 2 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@armhold
Copy link

armhold commented Oct 14, 2018

Steps to Reproduce the Problem

In a dir with a .env containing GO_ENV=development , run

  1. soda migrate -e test

Expected Behavior

The test environment should be used when -e test arg is given.

Actual Behavior

The development environment is used, ignoring the command line flag.

It's also surprising to me that the .env file will override GO_ENV. I.e. GO_ENV=test soda migrate will also defer to the .env file... is that intended?

Info

macOS 10.13.6, using latest pop (git: 0596d29)

@sio4
Copy link
Member

sio4 commented Oct 29, 2018

I also faced this problem.
Stored environment using .env is a nice feature but command line value and environment variables always should have most priority than file given one.

stanislas-m added a commit that referenced this issue Oct 31, 2018
stanislas-m added a commit that referenced this issue Nov 1, 2018
* Fix env resolution priority

Fixes #269

* Defer GO_ENV rollback only once
@sio4
Copy link
Member

sio4 commented Jun 4, 2022

Still, the same issue happens:

$ soda reset -e test
pop v6.0.2

[POP] 2022/06/04 20:40:03 info - drop app_development (...)
Error: couldn't drop database app_development: error dropping...

the database should be app_test for this case.

@sio4 sio4 self-assigned this Jun 4, 2022
@sio4 sio4 added the bug Something isn't working label Jun 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants