Load environment variables from .env file in Bash

if [ -f .env ]
then
  export $(cat .env | sed 's/#.*//g' | xargs)
fi