Skip to content

Commit

Permalink
♻️ Reverse order in .envrc
Browse files Browse the repository at this point in the history
  • Loading branch information
ddelange committed Feb 20, 2025
1 parent eaa0d98 commit 79b02a4
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions .envrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
# first source parent directories
# 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
# then overwrite with current directory env vars
# 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

0 comments on commit 79b02a4

Please sign in to comment.