From 158e4c32ad3c51eed7c5cdc482ede2d5650c17f0 Mon Sep 17 00:00:00 2001 From: Mike McClenaghan Date: Thu, 21 Mar 2013 19:46:41 -0600 Subject: [PATCH] Cleaned up environment file check --- bin/plow | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/bin/plow b/bin/plow index 06e0724..268eb6a 100755 --- a/bin/plow +++ b/bin/plow @@ -31,9 +31,11 @@ while test $# != 0; do case "$1" in --staging|staging) ENVIRONMENT=staging + ENV_FILE=.env.$ENVIRONMENT ;; - --production|production) + --production|production) ENVIRONMENT=production + ENV_FILE=.env.$ENVIRONMENT ;; --role) shift @@ -70,9 +72,18 @@ bail() { exit 1 } +<<<<<<< HEAD if [ ! $ENVIRONMENT ]; then echo "Assuming staging environment..." ENVIRONMENT="staging" +======= +if [ ! $ENV_FILE ]; then + ENV_FILE=.env +else + [[ -f $ENV_FILE ]] || bail "$ENV_FILE not found" + source $ENV_FILE + mkdir -p .plow && cat $ENV_FILE > .plow/plow.sh +>>>>>>> Cleaned up environment file check fi ENV_FILE=.env.$ENVIRONMENT