kennethreitz/autoenv — pull request #44 by ferrix (2013-03-12 11:47:00+00:00)
Title: Add autoenv_run() for manually executing files

When running autoenv_check_authz_and_run from command lines there are two
obvious problems:

1. The command is ugly
2. It does not expect to find a relative path and adds a relative path to the
auth file

I am using this new command inside my .env file to differentiate between global
and local environment settings. Now I can upload my .env into Git while my
passwords and environment-local settings (eg. PATH) will be hooked from my
`.local` file. This is my example .env:

use_env killer_app
export DATABASE_URL='postgres://root@localhost'

LOCAL_FILE=".local"
if [ -f $LOCAL_FILE -a ! -z $AUTOENV_AUTH_FILE ]; then
autoenv_run "$LOCAL_FILE"
fi

This provides some additional security when collaborating with others and
sharing some environment defaults needed by a 12 factor app.