Better dokku-client bash formatting

This commit is contained in:
Jose Diaz-Gonzalez
2015-01-11 22:36:12 -05:00
parent 8c8745ca4c
commit f293e9026d

View File

@@ -1,13 +1,11 @@
if [ -z "$DOKKU_HOST" ]
then
if [[ ! -z $DOKKU_HOST ]]; then
function dokku {
appname=$(git remote -v 2>/dev/null | grep dokku | head -n 1 | cut -f1 -d' ' | cut -f2 -d':' 2>/dev/null)
if [ "$?" != "0" ]
then
if [[ "$?" != "0" ]]; then
donotshift="YES"
fi
if [ "$1" = "create" ]
then
if [[ "$1" = "create" ]]; then
appname=$(echo "print(elfs.GenName())" | lua -l elfs)
if git remote add dokku dokku@$DOKKU_HOST:$appname
then
@@ -18,15 +16,16 @@ then
return
fi
git push dokku master
else
if [ -z "$donotshift" ]
then
ssh dokku@$DOKKU_HOST $*
exit
fi
verb=$1
shift
ssh dokku@$DOKKU_HOST "$verb" "$appname" $@
return $?
fi
if [[ -z "$donotshift" ]]; then
ssh dokku@$DOKKU_HOST $*
exit
fi
verb=$1
shift
ssh dokku@$DOKKU_HOST "$verb" "$appname" $@
}
fi