mirror of
https://github.com/nushell/nu_scripts.git
synced 2024-08-16 17:00:32 +03:00
d6cf03e315
> 💡 **Note**
>
> greatly inspired by _Direnv_
this new "_nuenv_" hook will `source` any `.env.nu` file found in the
current directory as part of a hook.
in order to be a bit more safe, i've added `nuenv allow` and `nuenv
disallow` that will keep track of which "env" files are allowed to be
sourced, i.e. if a file is not allowed, then you'll have to run `nuenv
allow` first.
## example usage
```nushell
use nu-hooks/nuenv/hook.nu [ "nuenv allow", "nuenv disallow" ]
$env.config.hooks.env_change.PWD = (use nu-hooks/nuenv/hook.nu; hook setup)
```
|
||
---|---|---|
.. | ||
nu-hooks | ||
nupm.nuon |