-
-
Save joseluisq/ffd42d8d9b9e33cba509b689411b5662 to your computer and use it in GitHub Desktop.
Load environment variables from a .env file from a Bash shell script
This file contains 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 | |
set -e | |
set -u | |
if [ -f .env ]; then | |
export $(cat .env | xargs) | |
else | |
echo ".env file not found" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment