commandbox-modules/commandbox-dotenv

Have a new function for updating ENV from example file.

gpickin opened this issue · 0 comments

Story: the .env.example file had been updated, but I didn't know to update my .env... since it wasn't a new key, but an old key that changed, my app behaved weird, until I figured out there had been a change.

I would like (and might build) a new function, or maybe update the populate function to allow you to set your variables, but only on the ones that differ.

I would love a way to see what changes exist between the .env and .env.example and overlay it nicely so we keep the formatting of the .env.example too.

So look through the .env.example, line by line replace the value, if the user wants to keep their .env file value.
You could skip the empty values in the .env.example because we always want something over nothing (I would think)

It bit me pretty hard on a big .env file, so this could help.
We could also detech timestamp changes in a .env.example - and prompt this if its newer than the .env file... just to verify you have updated keys, and not always waiting for that to happen.

Thoughts?