Last active
March 18, 2016 22:39
-
-
Save mojowen/baa52d0ddf695c0d6129 to your computer and use it in GitHub Desktop.
Load ENV file into
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # Use on .env files, structured as KEY=VALUE. Will load into bash env | |
| # Must be called with $ . load.sh | |
| ENV_FILE=${1:-'./.env'} | |
| cat $ENV_FILE | awk -F"=" '{print "Loading " $1}' | |
| declare -a $(cat $ENV_FILE | awk -F"=" '{print $1"="$2}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment