-
-
Save guitsaru/6259658af15d21cc224bd7c6b5785252 to your computer and use it in GitHub Desktop.
Dotenv bash helpers
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
#!/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 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
#!/bin/bash | |
DOTENV_ENV=dev dotenv "$@" |
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
#!/bin/bash | |
DOTENV_ENV=test dotenv "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment