pkgx
pkgx copied to clipboard
magic: support `/.env(rc)?/` files
if we find .env
or .envrc
files then load them.
support it the same as https://direnv.net does.
/cc @jhheider, @jonchang, @mfts for opinion
My biggest annoyance with direnv is that it wants export statements, so a "normal" env doesn't work out of the box. But matching ^/(export )?[:alnum:]+=.*$/ should be easy enough.
It sounds good! I admit that I've never used any of the autoenv stuff (and in fact have tea
's zsh
magic turned off), but it would be good to document e.g. in what order tea
searches for the appropriate env files and possibly have a command when within the env that shows how the current environment was determined.
yeah I agree docs will be important, already we have a hierarchy of files that we don't document (README/package.json/VERSION, more in fact)
and in fact have tea's zsh magic turned off
fortunately getting the env without this is as easy as typing tea
before everything. Though tea/cmd will make it so you can have a brew
like install for everything. Certainly don't want anyone to feel they must use tea.env it's more a “this is a neat feature we will try to convince you to use over time—provided it is actually neat” thing.
In general our attitude is: here's a bunch of neat ways to do things, hopefully some of them fit into your workflows.
This is partly done by 0.23. I elected to only parse out the export
lines. I think we should pkg direnv
for users who want the full functionality.