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

Don't replace commented DB_HOST on my .env #117

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Don't replace commented DB_HOST on my .env #117

wants to merge 1 commit into from

Conversation

yh1224
Copy link

@yh1224 yh1224 commented Sep 5, 2019

I lost my commented line for alternative DB host :-(
I think it's better to replace active DB_HOST line only.

@fideloper
Copy link
Contributor

I think this creates a backup of your .env file before changing it - is that not the case for you? (It might depend on if you're on MacOS or not, due to how sed works, but I'd have to double check!

In any case, sorry about that!

Can you confirm: Does this change only swap out the first instance of DB_HOST it finds?

@yh1224
Copy link
Author

yh1224 commented Oct 4, 2019

@fideloper sorry for late reply.

Yes, I can recover from .bak file, so It's not too much problem.
But I think there's no need to change even inactive configurations.

Applying to this batch to original .env like below:

DB_HOST=localhost
#DB_HOST=db

BEFORE

DB_HOST=mysql
#DB_HOST=mysql         ... also changes inactive configuration

AFTER

DB_HOST=mysql          ... change only active configuration
#DB_HOST=db            ... keep inactive configuration

Can you confirm: Does this change only swap out the first instance of DB_HOST it finds?

It swap out all lines of active DB_HOST (if exists multiple) as before.

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.

3 participants