vessel icon indicating copy to clipboard operation
vessel copied to clipboard

Don't replace commented DB_HOST on my .env

Open yh1224 opened this issue 6 years ago • 2 comments

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

yh1224 avatar Sep 05 '19 02:09 yh1224

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?

fideloper avatar Sep 05 '19 13:09 fideloper

@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.

yh1224 avatar Oct 04 '19 03:10 yh1224