Skip to content

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

Open
yh1224 wants to merge 1 commit intoshipping-docker:masterfrom
yh1224:patch-1
Open

Don't replace commented DB_HOST on my .env#117
yh1224 wants to merge 1 commit intoshipping-docker:masterfrom
yh1224:patch-1

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