diff --git a/cli-entrypoint.sh b/cli-entrypoint.sh index 471e1ccc77..b0f77dbb63 100755 --- a/cli-entrypoint.sh +++ b/cli-entrypoint.sh @@ -2,13 +2,9 @@ set -euo pipefail # first arg is `-f` or `--some-option` -if [ "${1#-}" != "$1" ]; then - set -- wp "$@" -fi - -# if our command is a valid wp-cli subcommand, let's invoke it through wp-cli instead +# or if our command is a valid wp-cli subcommand, let's invoke it through wp-cli instead # (this allows for "docker run wordpress:cli help", etc) -if wp --path=/dev/null help "$1" > /dev/null 2>&1; then +if [ "${1#-}" != "$1" ] || wp help "$1" > /dev/null 2>&1; then set -- wp "$@" fi diff --git a/php7.2/cli/docker-entrypoint.sh b/php7.2/cli/docker-entrypoint.sh index 471e1ccc77..b0f77dbb63 100755 --- a/php7.2/cli/docker-entrypoint.sh +++ b/php7.2/cli/docker-entrypoint.sh @@ -2,13 +2,9 @@ set -euo pipefail # first arg is `-f` or `--some-option` -if [ "${1#-}" != "$1" ]; then - set -- wp "$@" -fi - -# if our command is a valid wp-cli subcommand, let's invoke it through wp-cli instead +# or if our command is a valid wp-cli subcommand, let's invoke it through wp-cli instead # (this allows for "docker run wordpress:cli help", etc) -if wp --path=/dev/null help "$1" > /dev/null 2>&1; then +if [ "${1#-}" != "$1" ] || wp help "$1" > /dev/null 2>&1; then set -- wp "$@" fi diff --git a/php7.3/cli/docker-entrypoint.sh b/php7.3/cli/docker-entrypoint.sh index 471e1ccc77..b0f77dbb63 100755 --- a/php7.3/cli/docker-entrypoint.sh +++ b/php7.3/cli/docker-entrypoint.sh @@ -2,13 +2,9 @@ set -euo pipefail # first arg is `-f` or `--some-option` -if [ "${1#-}" != "$1" ]; then - set -- wp "$@" -fi - -# if our command is a valid wp-cli subcommand, let's invoke it through wp-cli instead +# or if our command is a valid wp-cli subcommand, let's invoke it through wp-cli instead # (this allows for "docker run wordpress:cli help", etc) -if wp --path=/dev/null help "$1" > /dev/null 2>&1; then +if [ "${1#-}" != "$1" ] || wp help "$1" > /dev/null 2>&1; then set -- wp "$@" fi diff --git a/php7.4/cli/docker-entrypoint.sh b/php7.4/cli/docker-entrypoint.sh index 471e1ccc77..b0f77dbb63 100755 --- a/php7.4/cli/docker-entrypoint.sh +++ b/php7.4/cli/docker-entrypoint.sh @@ -2,13 +2,9 @@ set -euo pipefail # first arg is `-f` or `--some-option` -if [ "${1#-}" != "$1" ]; then - set -- wp "$@" -fi - -# if our command is a valid wp-cli subcommand, let's invoke it through wp-cli instead +# or if our command is a valid wp-cli subcommand, let's invoke it through wp-cli instead # (this allows for "docker run wordpress:cli help", etc) -if wp --path=/dev/null help "$1" > /dev/null 2>&1; then +if [ "${1#-}" != "$1" ] || wp help "$1" > /dev/null 2>&1; then set -- wp "$@" fi