Skip to content

Commit b370896

Browse files
committed
Cleaned up and improved drush subcommand
1 parent 2844ef7 commit b370896

1 file changed

Lines changed: 6 additions & 14 deletions

File tree

scripts/itkdev-docker-compose

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,8 @@ EOF
429429
trap " " INT
430430
# Start the docker compose with Xdebug enabled
431431
# @todo Should we disable logs, e.g. by sending it to /dev/null?
432+
# Note: `DRUSH_ALLOW_XDEBUG=1` is set in our php*-fpm container to allow debugging Drush commands
433+
# (cf. https://github.com/drush-ops/drush/blob/14.x/docs/commands.md#xdebug)
432434
PHP_XDEBUG_MODE=debug PHP_XDEBUG_WITH_REQUEST=yes docker_compose up
433435
trap - INT
434436

@@ -743,9 +745,9 @@ EOF
743745
;;
744746

745747
xdebug3)
746-
PHP_XDEBUG_MODE=debug \
747-
PHP_XDEBUG_WITH_REQUEST=yes \
748-
docker_compose up -d
748+
# Note: `DRUSH_ALLOW_XDEBUG=1` is set in our php*-fpm container to allow debugging Drush commands
749+
# (cf. https://github.com/drush-ops/drush/blob/14.x/docs/commands.md#xdebug)
750+
PHP_XDEBUG_MODE=debug PHP_XDEBUG_WITH_REQUEST=yes docker_compose up --detach
749751

750752
cat <<'EOF' | sed "s|«project directory»|$PWD|"
751753
@@ -824,17 +826,7 @@ EOF
824826
;;
825827

826828
drush)
827-
root=/app
828-
if [ -d $docker_compose_dir/web ]; then
829-
root=/app/web
830-
fi
831-
if [ -e $docker_compose_dir/vendor/bin/drush.php ]; then
832-
docker_compose exec phpfpm php /app/vendor/bin/drush.php --root=$root "$@"
833-
elif [ -e $docker_compose_dir/vendor/bin/drush ]; then
834-
docker_compose exec phpfpm /app/vendor/bin/drush --root=$root "$@"
835-
else
836-
docker_compose run --rm drush --root=$root "$@"
837-
fi
829+
docker_compose exec phpfpm vendor/bin/drush "$@"
838830
;;
839831

840832
composer)

0 commit comments

Comments
 (0)