Skip to content

Instantly share code, notes, and snippets.

@timvw
Created April 30, 2024 07:58
Show Gist options
  • Save timvw/18072944c109c71640a31c5ef2cbba8c to your computer and use it in GitHub Desktop.
Save timvw/18072944c109c71640a31c5ef2cbba8c to your computer and use it in GitHub Desktop.
Shell function to load a dotenv file
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