Skip to content

Instantly share code, notes, and snippets.

@kwstannard
Last active September 24, 2019 20:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kwstannard/9563140dac5a0c9d66208c16290e529c to your computer and use it in GitHub Desktop.
Save kwstannard/9563140dac5a0c9d66208c16290e529c to your computer and use it in GitHub Desktop.
dotenv, but its a one line bash function
$ be() { if [ -f .env ]; then env $(<.env grep -v "^#") bundle exec "$@"; else bundle exec "$@"; fi; }
$ echo HELLO=WORLD > .env
$ echo "# a comment" >> .env
$ be ruby -e 'puts ENV["HELLO"]'
WORLD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment