Properly retrieve and parse the app name from git remote
This commit is contained in:
@@ -3,8 +3,17 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
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
|
||||
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user