Last active
September 24, 2019 20:42
-
-
Save kwstannard/9563140dac5a0c9d66208c16290e529c to your computer and use it in GitHub Desktop.
dotenv, but its a one line bash function
This file contains hidden or 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
$ 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