rsgalloway / envstack

Stacked environment variable management system.
Other
3 stars 0 forks source link

whichenv executable #9

Open rsgalloway opened 2 weeks ago

rsgalloway commented 2 weeks ago

create a whichenv executable that wraps envstack -t:

$ whichenv HELLO
HELLO: /path/to/source/stack.env
rsgalloway commented 1 week ago

this could just be an alias for envstack --trace:

$ alias whichenv='envstack -t'
$ whichenv HELLO
HELLO: /path/to/stack.env

but what if we didn't know where an env var was defined? It would search all the env stacks to find it and print the path to the .env file:

$ whichenv FOO
/path/to/thing.env

or the env stack name:

$ whichenv FOO
thing