Skip to content

Instantly share code, notes, and snippets.

@collinschaafsma
Created April 6, 2012 22:22
Show Gist options
  • Save collinschaafsma/2323523 to your computer and use it in GitHub Desktop.
Save collinschaafsma/2323523 to your computer and use it in GitHub Desktop.
Autoload an .env file in your zshell
# Put this in ~/.zshrc
chpwd() {
if [ -f ".env" ]; then source .env; fi
}
# Then make .env files in your project directories that look like this.
export S3_SECRET="<s3_secret>"
export S3_KEY="<s3_key>"
# Then add .env to ~/.gitignore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment