Last active
September 20, 2016 23:20
-
-
Save doughsay/3f12cad73984255bf5a5e3ce9f00105a to your computer and use it in GitHub Desktop.
Dotenv bash helpers
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 | |
export DOTENV_ENV=${DOTENV_ENV:-dev} | |
GIT_DIR=$(git rev-parse --show-toplevel 2>/dev/null || pwd) | |
DOTENV_FILE=$GIT_DIR/.env.$DOTENV_ENV | |
if [ -e $DOTENV_FILE ]; then source $DOTENV_FILE; fi | |
$@ |
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 | |
DOTENV_ENV=dev dotenv "$@" |
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 | |
DOTENV_ENV=test dotenv "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment