Skip to content

Instantly share code, notes, and snippets.

@ayr-ton
Forked from mihow/load_dotenv.sh
Last active April 4, 2022 18:08
Show Gist options
  • Save ayr-ton/a607f5d38b7e3a7233fbd1386a6611aa to your computer and use it in GitHub Desktop.
Save ayr-ton/a607f5d38b7e3a7233fbd1386a6611aa to your computer and use it in GitHub Desktop.
Load environment variables from dotenv / .env file in Bash
function load-env() {
if [ -e .env ]
then
export $(cat .env | xargs)
echo ".env exported with success! 🥄"
else
echo "There's no spoon 🐲"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment