graphql-boilerplates / graphql-boilerplate-install

5 stars 2 forks source link

writeEnv: add append option #3

Open marktani opened 6 years ago

marktani commented 6 years ago

Currently, writeEnv overwrites the file content of .env. An append option would be super useful to support existing .env files.

For example, in the node-advanced boilerplate, I use env var APP_SECRET that is gone after running writeEnv.

kbrandwijk commented 6 years ago

Yeah, that process should be more intelligent. Maybe using dotenv-save.

marktani commented 6 years ago

For now, I'm using replaceInFiles(['.env], ...) instead of writeEnv and it fulfills my needs 🙂 So I'm not sure if we need to change the way writeEnv works.

kbrandwijk commented 6 years ago

There's also a singular version replaceInFile for single file replacement by the way...