Skip to content

Instantly share code, notes, and snippets.

@stevengonsalvez
Created August 23, 2022 15:21
Show Gist options
  • Save stevengonsalvez/0bb3189488d98fefa3c184c8c9ca26cb to your computer and use it in GitHub Desktop.
Save stevengonsalvez/0bb3189488d98fefa3c184c8c9ca26cb to your computer and use it in GitHub Desktop.
de() {
  set -o allexport
  eval $(cat '.env' | sed -e '/^#/d;/^\s*$/d' -e 's/\(\w*\)[ \t]*=[ \t]*\(.*\)/\1=\2/' -e "s/=['\"]\(.*\)['\"]/=\1/g" -e "s/'/'\\\''/g" -e "s/=\(.*\)/='\1'/g")
  set +o allexport
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment