From 2262709566345e117421d470f494e1a553f4eb37 Mon Sep 17 00:00:00 2001 From: Basil Crow Date: Sat, 15 Jan 2022 12:13:27 -0800 Subject: [PATCH] [PATCH] Allow the use of multiple arguments (#254) --- jenkins-agent | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jenkins-agent b/jenkins-agent index 4a6760a93..bf1b39451 100755 --- a/jenkins-agent +++ b/jenkins-agent @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/usr/bin/env bash # The MIT License # @@ -37,9 +37,9 @@ # the agent skips connecting to an HTTP(S) port for connection info. # * JENKINS_PROTOCOLS: Specify the remoting protocols to attempt when instanceIdentity is provided. -if [ $# -eq 1 ] && [ "${1#-}" = "$1" ] ; then +if [ "${1:0:1}" != '-' ]; then - # if `docker run` only has one arguments and it is not an option as `-help`, we assume user is running alternate command like `bash` to inspect the image + # if `docker run`'s first argument does not look like a flag, we assume the user is running an alternate command like `bash` to inspect the image exec "$@" else