Skip to content

Commit c0d11ed

Browse files
terencehonlesyosifkit
authored andcommitted
remove --path argument so plugins are loaded
combine ifs in the cli entrypoint
1 parent b112774 commit c0d11ed

File tree

4 files changed

+8
-24
lines changed

4 files changed

+8
-24
lines changed

cli-entrypoint.sh

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,9 @@
22
set -euo pipefail
33

44
# first arg is `-f` or `--some-option`
5-
if [ "${1#-}" != "$1" ]; then
6-
set -- wp "$@"
7-
fi
8-
9-
# if our command is a valid wp-cli subcommand, let's invoke it through wp-cli instead
5+
# or if our command is a valid wp-cli subcommand, let's invoke it through wp-cli instead
106
# (this allows for "docker run wordpress:cli help", etc)
11-
if wp --path=/dev/null help "$1" > /dev/null 2>&1; then
7+
if [ "${1#-}" != "$1" ] || wp help "$1" > /dev/null 2>&1; then
128
set -- wp "$@"
139
fi
1410

php7.2/cli/docker-entrypoint.sh

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,9 @@
22
set -euo pipefail
33

44
# first arg is `-f` or `--some-option`
5-
if [ "${1#-}" != "$1" ]; then
6-
set -- wp "$@"
7-
fi
8-
9-
# if our command is a valid wp-cli subcommand, let's invoke it through wp-cli instead
5+
# or if our command is a valid wp-cli subcommand, let's invoke it through wp-cli instead
106
# (this allows for "docker run wordpress:cli help", etc)
11-
if wp --path=/dev/null help "$1" > /dev/null 2>&1; then
7+
if [ "${1#-}" != "$1" ] || wp help "$1" > /dev/null 2>&1; then
128
set -- wp "$@"
139
fi
1410

php7.3/cli/docker-entrypoint.sh

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,9 @@
22
set -euo pipefail
33

44
# first arg is `-f` or `--some-option`
5-
if [ "${1#-}" != "$1" ]; then
6-
set -- wp "$@"
7-
fi
8-
9-
# if our command is a valid wp-cli subcommand, let's invoke it through wp-cli instead
5+
# or if our command is a valid wp-cli subcommand, let's invoke it through wp-cli instead
106
# (this allows for "docker run wordpress:cli help", etc)
11-
if wp --path=/dev/null help "$1" > /dev/null 2>&1; then
7+
if [ "${1#-}" != "$1" ] || wp help "$1" > /dev/null 2>&1; then
128
set -- wp "$@"
139
fi
1410

php7.4/cli/docker-entrypoint.sh

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,9 @@
22
set -euo pipefail
33

44
# first arg is `-f` or `--some-option`
5-
if [ "${1#-}" != "$1" ]; then
6-
set -- wp "$@"
7-
fi
8-
9-
# if our command is a valid wp-cli subcommand, let's invoke it through wp-cli instead
5+
# or if our command is a valid wp-cli subcommand, let's invoke it through wp-cli instead
106
# (this allows for "docker run wordpress:cli help", etc)
11-
if wp --path=/dev/null help "$1" > /dev/null 2>&1; then
7+
if [ "${1#-}" != "$1" ] || wp help "$1" > /dev/null 2>&1; then
128
set -- wp "$@"
139
fi
1410

0 commit comments

Comments
 (0)