From 45120c5e431900857d05b753a8a1c32b49ea265c Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Wed, 14 Jan 2015 04:32:07 -0500 Subject: [PATCH] Pull DOKKU_HOST from dokku remote host if not otherwise set --- contrib/dokku_client.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/contrib/dokku_client.sh b/contrib/dokku_client.sh index deefc046a..c7be9e289 100755 --- a/contrib/dokku_client.sh +++ b/contrib/dokku_client.sh @@ -1,6 +1,12 @@ #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x +if [[ -z $DOKKU_HOST ]]; then + if [[ -d .git ]] || git rev-parse --git-dir > /dev/null 2>&1; then + DOKKU_HOST=$(git remote -v 2>/dev/null | grep -Ei "^dokku" | head -n 1 | cut -f1 -d' ' | cut -f2 -d '@' | cut -f1 -d':' 2>/dev/null) + fi +fi + if [[ ! -z $DOKKU_HOST ]]; then function _dokku { appname=""