Properly retrieve and parse the app name from git remote
This commit is contained in:
1 parent
3e05a8c8ac
commit
aec4543b61
1 file changed
+11
-2
+11
-2
@@ -3,8 +3,17 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
|||||||
|
|
||||||
if [[ ! -z $DOKKU_HOST ]]; then
|
if [[ ! -z $DOKKU_HOST ]]; 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=""
|
||||||
if [[ "$?" != "0" ]]; then
|
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"
|
donotshift="YES"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user