T
Task2w ago
ToshY

Is it possible to get a list of just the environment variable (names) that are used from `dotenv`?

I have the following taskfile
version: '3'

dotenv:
- .env
- .env.example

tasks:
default:
cmds:
- task --list

show:env:names:
desc: Show environment variables
cmds:
- # ...
version: '3'

dotenv:
- .env
- .env.example

tasks:
default:
cmds:
- task --list

show:env:names:
desc: Show environment variables
cmds:
- # ...
With a .env like this
HELLO=world
HELLO=world
And .env.example like this
HELLO=darkness
WELCOME=back
HELLO=darkness
WELCOME=back
Is it possible to get a list containing HELLO and WELCOME ? The actual values are not that relevant, I'm just interested in getting a list of environment variables names so I can use it with envsubst.
1 Reply
andreynering
andreynering2w ago
Unfortunately, we don't have any way to get that list currently

Did you find this page helpful?