-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path.envrc
15 lines (14 loc) · 907 Bytes
/
.envrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# ref https://direnv.net/docs/installation.html
# when direnv is installed, env vars will be automatically exported when cd'ing into a directory, and unset when cd'ing out of the directory
# brew install direnv
# install direnv hook ref https://direnv.net/docs/hook.html
# hook for bash
# cat ~/.bashrc | grep 'direnv hook' || ( echo 'eval "$(direnv hook bash)"' >> ~/.bashrc && eval "$(direnv hook bash)" )
# hook for zsh
# cat ~/.zshrc | grep 'direnv hook' || ( echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc && eval "$(direnv hook zsh)" )
# run once in this directory to trust this .envrc file:
# direnv allow
# any `.envrc` files in this directory's parents will first be sourced by direnv when cd'ing into this directory
source_up_if_exists
# write your secrets in the `.env` file (gitignore'd) - these will take presedence over env vars exported in parent directories
source_env_if_exists .env