Created
April 30, 2024 07:58
-
-
Save timvw/18072944c109c71640a31c5ef2cbba8c to your computer and use it in GitHub Desktop.
Shell function to load a dotenv file
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
dotenv() { | |
readonly env_file=${1:?"The env_file must be specified."} | |
set -o allexport | |
source ${env_file} | |
set +o allexport | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment