Skip to content

Commit e81bdcc

Browse files
committed
use exec instead of run
1 parent 914e929 commit e81bdcc

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

wpcli.sh

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,12 @@ WEB_WP_DIR=/var/www/html
1515
WEB_WP_URL=http://localhost:8080
1616

1717
# Call WP-CLI with appropriate site arguments via Docker
18-
#
19-
# docker compose run redirects the stderr of any invoked executables to
20-
# stdout. The only messages that will appear on stderr are issued by
21-
# docker compose run itself. This appears to be an undocumented "feature":
22-
# https://docs.docker.com/engine/reference/commandline/compose_run/
23-
#
24-
# The "2>/dev/null" below silences the messages from docker compose run.
25-
# For example, the output like the following will not be visible:
26-
# [+] Creating 2/0
27-
# ✔ Container cc-wordpress-db Running 0.0s
28-
# ✔ Container cc-web Running 0.0s
29-
docker compose run --rm \
18+
docker compose exec \
3019
--env WP_ADMIN_USER="${WP_ADMIN_USER}" \
3120
--env WP_ADMIN_PASS="${WP_ADMIN_PASS}" \
3221
--env WP_ADMIN_EMAIL="${WP_ADMIN_EMAIL}" \
3322
index-wpcli \
3423
/usr/local/bin/wp \
3524
--path="${WEB_WP_DIR}" \
3625
--url="${WEB_WP_URL}" \
37-
"${@}" \
38-
2>/dev/null
26+
"${@}"

0 commit comments

Comments
 (0)