Better dokku-client bash formatting

This commit is contained in:
Jose Diaz-Gonzalez committed 2015-01-16 16:57:25 -05:00
1 parent 8c8745ca4c
commit f293e9026d
1 file changed
+14 -15
+14 -15
View File
@@ -1,13 +1,11 @@
if [ -z "$DOKKU_HOST" ] if [[ ! -z $DOKKU_HOST ]]; then
then
function dokku { function dokku {
appname=$(git remote -v 2>/dev/null | grep dokku | head -n 1 | cut -f1 -d' ' | cut -f2 -d':' 2>/dev/null) appname=$(git remote -v 2>/dev/null | grep dokku | head -n 1 | cut -f1 -d' ' | cut -f2 -d':' 2>/dev/null)
if [ "$?" != "0" ] if [[ "$?" != "0" ]]; then
then
donotshift="YES" donotshift="YES"
fi fi
if [ "$1" = "create" ]
then if [[ "$1" = "create" ]]; then
appname=$(echo "print(elfs.GenName())" | lua -l elfs) appname=$(echo "print(elfs.GenName())" | lua -l elfs)
if git remote add dokku dokku@$DOKKU_HOST:$appname if git remote add dokku dokku@$DOKKU_HOST:$appname
then then
@@ -18,15 +16,16 @@ then
return return
fi fi
git push dokku master git push dokku master
else return $?
if [ -z "$donotshift" ]
then
ssh dokku@$DOKKU_HOST $*
exit
fi
verb=$1
shift
ssh dokku@$DOKKU_HOST "$verb" "$appname" $@
fi fi
if [[ -z "$donotshift" ]]; then
ssh dokku@$DOKKU_HOST $*
exit
fi
verb=$1
shift
ssh dokku@$DOKKU_HOST "$verb" "$appname" $@
} }
fi fi