Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
This little shell function allows to set environment variables when you cd into that directory.
# Note: this is just a fragment that you should put in your ~/.bash_profile
# Tested on Mac only!
# If you want a more sophisticated and feature rich solution here are some pointers:
# -
# -
function cd_ {
if [ -e .env_off ] ; then
. .env_off
builtin cd "$*"
if [ -e .env ] ; then
. .env
alias cd=cd_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.