Skip to content

Instantly share code, notes, and snippets.

@conmute
Last active July 2, 2018 14:32
Show Gist options
  • Save conmute/b5bb8005cd7db3fffe69eb68b3138b29 to your computer and use it in GitHub Desktop.
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`
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