flemay / envvars

Give your environment variables the love they deserve.
MIT License
20 stars 4 forks source link

if example is empty, we still need the equal sign #6

Closed sandyleo26 closed 4 years ago

sandyleo26 commented 4 years ago

currently if we don't have an example

envvars:
  - name: AWS_DEFAULT_REGION
    desc: AWS Region to deploy to
    tags:
      - aws

the .env file will be generated like

AWS_DEFAULT_REGION

But i think it should be like

AWS_DEFAULT_REGION=

This can also prevent issue if i use envvars envfile to generate a .env and later invoke docker-compose with it.

i can submit a small pr to get it fixed if you think it makes sense.

flemay commented 4 years ago

Hi @sandyleo26 !

Thank you for contributing.

First off, the issue has been fixed with the latest release of Docker-Compose. Regardless of examples, we wanted the key-only .env file to work with Docker-Compose (described here).

Secondly, I personally prefer explicit. If a user wants to have AWS_DEFAULT_REGION=, then they should use example: "". This gives them the choice to have = or not when generating with example. If it defaults to =, then it would not be possible to have key-only without adding more code.

Finally, by not having the = means you can generate the .env with example values and use values of your host's environment variables for the rest.

Let me know what you think!

sandyleo26 commented 4 years ago

yes i think you're right. your comment is worth to be documented somewhere. i'll close the issue. thank you!