Pull DOKKU_HOST from dokku remote host if not otherwise set

This commit is contained in:
Jose Diaz-Gonzalez
2015-01-14 04:32:07 -05:00
parent 7f99fcb844
commit 45120c5e43

View File

@@ -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=""