envful icon indicating copy to clipboard operation
envful copied to clipboard

Display the description on missing vars report

Open micalevisk opened this issue 3 years ago â€ĸ 5 comments

Let's say we have a .env.example with this content:

### The URL to the database instance
DATABASE_URL=

### The app secret used to sign JSON Web Tokens
APP_SECRET=

### Google Analytics ID [optional]
GA_ID=

and the .env one has this:

DATABASE_URL=
APP_SECRET=
GA_ID=

I think would be cool if the check command displays the description of missing ones like

Checking environment...
The process is missing required environment variables:
❌ Missing variable: DATABASE_URL
â„šī¸ The URL to the database instance
❌ Missing variable: GA_ID
â„šī¸ The app secret used to sign JSON Web Tokens

micalevisk avatar Feb 28 '22 03:02 micalevisk

This is actually a feature I'm working on! I still need to upload the branch from my local machine + create the draft PR. Thanks for the suggestion, I will track this functionality in this issue 👍

arvindell avatar Feb 28 '22 03:02 arvindell

quick question: the ### mark are just identified if it's right above the env name, right?

because I have an env like this:

### bar ...

FOO=

and I don't expect that the first line to be treated as a description of FOO

micalevisk avatar Feb 28 '22 03:02 micalevisk

quick question: the ### mark are just identified if it's right above the env name, right?

because I have an env like this:

### bar ...

FOO=

and I don't expect that the first line to be treated as a description of FOO

Currently any triple # comment will be interpreted as the description of the next variable in the file, regardless of whether there are whitespace characters. If you'd prefer to only allow triple # comments right above the variable, I'll be glad to continue this in another issue 👐đŸŧ

arvindell avatar Feb 28 '22 04:02 arvindell

I guess this is fine, actually. I could change the ### to ## to circumvent this behavior.

I just miss this documented on https://github.com/arvindell/envful#how-to-declare-variables section

micalevisk avatar Feb 28 '22 04:02 micalevisk

I guess this is fine, actually. I could change the ### to ## to circumvent this behavior.

I just miss this documented on https://github.com/arvindell/envful#how-to-declare-variables section

You're right, just added it, thanks!

arvindell avatar Feb 28 '22 04:02 arvindell