This is a nushell script to help load your .env file into your shell environment.
- Check's if your $PWD changed - triggered by the nuenv hooks
- If it did, it will check if you were in a directory with a
.envfile before the change - If it finds a
.envfile, it will remove the environment variables from the shell set from the previous.envfile - It will then load the new
.envfile into the shell environment
To install NuEnv, you can clone this repository into your nushell scripts folder and sourcing the nuenv.nu script in your nu config file:
git clone https://github.com/fancy-whale/nuenv.git ($nu.default-config-dir | path join scripts/nuenv)
echo "\nsource nuenv/nuenv.nu" | save --append $nu.config-path