Last active
July 2, 2018 14:32
-
-
Save conmute/b5bb8005cd7db3fffe69eb68b3138b29 to your computer and use it in GitHub Desktop.
Load local environment variable files into current scope of terminal session, if any. Just paste to your `.bash_rc/profile`
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
env_file_names=( | |
'./.env' | |
'./.env.local' | |
) | |
for file in ${env_file_names[*]} | |
do | |
if [ -f "${file}" ]; then | |
echo "Found local environment file: $file" | |
echo "Loading..." | |
. $file | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment