Skip to content

Instantly share code, notes, and snippets.

@dogterbox
Last active April 3, 2023 06:23
Show Gist options
  • Save dogterbox/5006ac975a03faeb6585b3bf102b98ec to your computer and use it in GitHub Desktop.
Save dogterbox/5006ac975a03faeb6585b3bf102b98ec to your computer and use it in GitHub Desktop.
Managing Environments with direnv (.envrc)
# REF: https://stackabuse.com/managing-python-environments-with-direnv-and-pyenv/
# installing
curl -sfL https://direnv.net/install.sh | bash
# with bash
echo 'eval "$(direnv hook bash)"' >> ~/.bashrc
source ~/.bashrc
# with zsh
# echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc
# source ~/.zshrc
# config .envrc
echo 'export MY_ENV=hello' > .envrc
direnv allow
# echo $MY_ENV
# >> hello
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment