From ff18061987eb15aea67909618871f359e4f0e5bd Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Wed, 13 Mar 2024 22:43:49 -0400 Subject: [PATCH] fix: correctly prepend argument to passed ssh args --- contrib/dokku_client.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/contrib/dokku_client.sh b/contrib/dokku_client.sh index 654acf03c..d2c7c4f04 100755 --- a/contrib/dokku_client.sh +++ b/contrib/dokku_client.sh @@ -188,14 +188,13 @@ main() { [[ " storage:ensure-directory " == *" $CMD "* ]] && unset APP [[ "$CMD" =~ events*|plugin*|ssh-keys* ]] && unset APP [[ -n "$APP_ARG" ]] && [[ "$APP_ARG" == "--global" ]] && unset APP - [[ -n "$@" ]] && [[ -n "$APP" ]] && app_arg="--app $APP" + if [[ -n "$@" ]] && [[ -n "$APP" ]]; then + set -- "$APP" "$@" + set -- "--app" "$@" + fi # echo "ssh -o LogLevel=QUIET -p $DOKKU_PORT -t dokku@$DOKKU_REMOTE_HOST -- $app_arg $@" local ssh_args=("-o" "LogLevel=QUIET" "-p" "$DOKKU_PORT" "-t" "dokku@$DOKKU_REMOTE_HOST" "--") - if [[ -n "$app_arg" ]]; then - ssh_args+=("'$app_arg $@'") - else - ssh_args+=("$@") - fi + ssh_args+=("$@") ssh "${ssh_args[@]}" || { ssh_exit_code="$?" echo " ! Failed to execute dokku command over ssh: exit code $?" 1>&2