Skip to content

Instantly share code, notes, and snippets.

@guitsaru
Forked from doughsay/dotenv
Last active September 20, 2016 23:12
Show Gist options
  • Save guitsaru/6259658af15d21cc224bd7c6b5785252 to your computer and use it in GitHub Desktop.
Save guitsaru/6259658af15d21cc224bd7c6b5785252 to your computer and use it in GitHub Desktop.
Dotenv bash helpers
#!/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
$@
#!/bin/bash
DOTENV_ENV=dev dotenv "$@"
#!/bin/bash
DOTENV_ENV=test dotenv "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment