psecio / gatekeeper

Gatekeeper: An Authentication & Authorization Library
366 stars 23 forks source link

Setup should check if vars exist, not just append #52

Open Swader opened 8 years ago

Swader commented 8 years ago

After executing the full setup procedure, the script will write vars into .env regardless of whether or not they're already there:

DB_USER=homestead
DB_PASS=secret
DB_HOST=localhost
DB_NAME=adoptify_gk

MAILGUN_KEY=key-foo
MAILGUN_DOMAIN=mydomain-or-sandbox-url

DEBUG=true
DB_USER=homestead
DB_PASS=secret
DB_HOST=localhost
DB_NAME=adoptify_gk

This is a nuisance in projects that come with an example .env already populated with some values. The script should check if they exist and only replace them.

Furthermore, and somewhat related to #51, these constants should be namespaced as GK_DB_USER or something, since it's not only possible but also highly likely that a different database (with a different user account and maybe even server) will be used for the actual application.