Skip to content

Instantly share code, notes, and snippets.

@elcuervo
Created August 16, 2012 23:02
Show Gist options
  • Save elcuervo/3374362 to your computer and use it in GitHub Desktop.
Save elcuervo/3374362 to your computer and use it in GitHub Desktop.
# Autoload .env files
load_env_file() {
if [ -f ".env" ]; then export $(grep -v '#' .env); fi;
}
# Load for .env files when changing dir
chpwd() { load_env_file }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment