Created
August 9, 2017 13:01
-
-
Save esfourteen-zz/e9127f8b8d73a72d9f608a69dbe0d5e6 to your computer and use it in GitHub Desktop.
if DATABASE_URL is empty set via .env file if present
This file contains 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
#!/bin/bash | |
[ -z "$DATABASE_URL" ] && [ -f .env ] && source .env | |
echo "DATABASE_URL=$DATABASE_URL" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This won't work if say you wanted to migrate your test db locally. This is why originally I had these vars separated out before.