formatting

This commit is contained in:
Jose Diaz-Gonzalez
2015-01-14 04:27:26 -05:00
parent 1eb01db8f9
commit d8fa69c5f4

View File

@@ -2,47 +2,47 @@
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
if [[ ! -z $DOKKU_HOST ]]; then
function _dokku {
appname=""
if [ -d .git ] || git rev-parse --git-dir > /dev/null 2>&1; then
set +e
appname=$(git remote -v 2>/dev/null | grep -Ei "^dokku" | head -n 1 | cut -f1 -d' ' | cut -f2 -d':' 2>/dev/null)
set -e
else
echo "This is not a git repository"
exit 1
fi
function _dokku {
appname=""
if [ -d .git ] || git rev-parse --git-dir > /dev/null 2>&1; then
set +e
appname=$(git remote -v 2>/dev/null | grep -Ei "^dokku" | head -n 1 | cut -f1 -d' ' | cut -f2 -d':' 2>/dev/null)
set -e
else
echo "This is not a git repository"
exit 1
fi
if [[ "$appname" != "" ]]; then
donotshift="YES"
fi
if [[ "$appname" != "" ]]; then
donotshift="YES"
fi
if [[ "$1" = "create" ]]; then
appname=$(echo "print(elfs.GenName())" | lua -l elfs)
if git remote add dokku dokku@$DOKKU_HOST:$appname
then
echo "-----> Dokku remote added at $DOKKU_HOST"
echo "-----> Application name is $appname"
else
echo "! Dokku remote not added! Do you already have a dokku remote?"
return
fi
git push dokku master
return $?
fi
if [[ "$1" = "create" ]]; then
appname=$(echo "print(elfs.GenName())" | lua -l elfs)
if git remote add dokku dokku@$DOKKU_HOST:$appname
then
echo "-----> Dokku remote added at $DOKKU_HOST"
echo "-----> Application name is $appname"
else
echo "! Dokku remote not added! Do you already have a dokku remote?"
return
fi
git push dokku master
return $?
fi
if [[ -z "$donotshift" ]]; then
ssh dokku@$DOKKU_HOST $*
exit $?
fi
if [[ -z "$donotshift" ]]; then
ssh dokku@$DOKKU_HOST $*
exit $?
fi
verb=$1
shift
ssh dokku@$DOKKU_HOST "$verb" "$appname" $@
}
verb=$1
shift
ssh dokku@$DOKKU_HOST "$verb" "$appname" $@
}
if [[ "$0" == "dokku" ]] || [[ "$0" == *dokku_client.sh ]]; then
_dokku $@
exit $?
fi
if [[ "$0" == "dokku" ]] || [[ "$0" == *dokku_client.sh ]]; then
_dokku $@
exit $?
fi
fi