fix: choose the correct app when a named remote is specified in the remote ssh client

Closes #4838
This commit is contained in:
Jose Diaz-Gonzalez authored and GitHub committed 2021-10-05 13:18:19 -04:00
1 parent b41b5c0a68
commit b7c7155852
1 file changed
+1 -1
+1 -1
View File
@@ -104,7 +104,7 @@ main() {
if [[ -z "$APP" ]]; then if [[ -z "$APP" ]]; then
if [[ -d .git ]] || git rev-parse --git-dir >/dev/null 2>&1; then if [[ -d .git ]] || git rev-parse --git-dir >/dev/null 2>&1; then
set +e set +e
APP=$(git remote -v 2>/dev/null | grep -Ei "dokku@$DOKKU_REMOTE_HOST" | head -n 1 | cut -f2 -d'@' | cut -f1 -d' ' | cut -f2 -d':' 2>/dev/null) APP=$(git remote -v 2>/dev/null | grep -Ei "^${DOKKU_GIT_REMOTE}\s" | grep -Ei "dokku@$DOKKU_REMOTE_HOST" | head -n 1 | cut -f2 -d'@' | cut -f1 -d' ' | cut -f2 -d':' 2>/dev/null)
set -e set -e
else else
echo " ! This is not a git repository" 1>&2 echo " ! This is not a git repository" 1>&2