Commit Graph

1 Commits

Author SHA1 Message Date
a56c0b54fa feat(bins): add envy command
Quick and hacky bash script which supports loading .envrc files suitable
for direnv, but with support for local override files, and named
environment files, and supports looking for the .envrc* files upwards in
parent folders.

For example, when you run:

    envy echo hi

It will look in the current folder, and all parent folders for any files
named:

- .envrc
- .envrc.local
- .envrc.echo
- .envrc.echo.local

The first such file that is found is considered to be in the project
root, and all further files checked for will only be checked for in said
project root.

The first argument to envy is considered a environment name if there is
a matching .envrc.<name> file. If not such machine file is found, the
first argument is treated as part of the command you want to run.

Meaning with the above example, if ".envrc.echo" or ".envrc.echo.local"
exists, the command that will be executed is "hi", but if neither of
them exist, it will execute "echo hi".

To define environment variables in a .envrc* file, you use use bash's
export statement.
2021-09-15 19:21:07 +01:00