Skip to content

Instantly share code, notes, and snippets.

@webflo-dev
Created September 19, 2021 10:42
Show Gist options
  • Select an option

  • Save webflo-dev/e4a4cc5e2f6dd6b1bb2eb96b896bec97 to your computer and use it in GitHub Desktop.

Select an option

Save webflo-dev/e4a4cc5e2f6dd6b1bb2eb96b896bec97 to your computer and use it in GitHub Desktop.
Load env file
envup() {
local file=$([ -z "$1" ] && echo ".env" || echo ".env.$1")
if [ -f $file ]; then
set -a
source $file
set +a
else
echo "No $file file found" 1>&2
return 1
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment