Created
September 19, 2021 10:42
-
-
Save webflo-dev/e4a4cc5e2f6dd6b1bb2eb96b896bec97 to your computer and use it in GitHub Desktop.
Load env file
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
| envup() { | |
| local file=$([ -z "$1" ] && echo ".env" || echo ".env.$1") | |
| if [ -f $file ]; then | |
| set -a | |
| source $file | |
| set +a | |
| else | |
| echo "No $file file found" 1>&2 | |
| return 1 | |
| fi | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment