Add ability to alias dokku_client.sh as dokku command locally

This commit is contained in:
Jose Diaz-Gonzalez committed 2015-01-16 16:57:26 -05:00
1 parent aec4543b61
commit 1eb01db8f9
1 file changed
+6 -1
+6 -1
View File
@@ -2,7 +2,7 @@
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
if [[ ! -z $DOKKU_HOST ]]; then if [[ ! -z $DOKKU_HOST ]]; then
function dokku { function _dokku {
appname="" appname=""
if [ -d .git ] || git rev-parse --git-dir > /dev/null 2>&1; then if [ -d .git ] || git rev-parse --git-dir > /dev/null 2>&1; then
set +e set +e
@@ -40,4 +40,9 @@ if [[ ! -z $DOKKU_HOST ]]; then
shift shift
ssh dokku@$DOKKU_HOST "$verb" "$appname" $@ ssh dokku@$DOKKU_HOST "$verb" "$appname" $@
} }
if [[ "$0" == "dokku" ]] || [[ "$0" == *dokku_client.sh ]]; then
_dokku $@
exit $?
fi
fi fi