Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 6 additions & 14 deletions scripts/itkdev-docker-compose
Original file line number Diff line number Diff line change
Expand Up @@ -542,9 +542,9 @@ fi

# Helper function to call `docker compose` in the right context
docker_compose () {
# Note: Apparently, using --project-directory or --file options for `docker compose` will break use of `$PWD` in
# compose file. Therefore, we `cd` before running `docker compose` command.
(cd "$docker_compose_dir" && COMPOSE_DOMAIN=${COMPOSE_DOMAIN} docker compose "$@")
# Note: Apparently, using --project-directory or --file options for `docker compose` will break use of `$PWD` in
# compose file. Therefore, we `cd` before running `docker compose` command.
(cd "$docker_compose_dir" && COMPOSE_DOMAIN=${COMPOSE_DOMAIN} docker compose "$@")
}

cmd="$1"
Expand Down Expand Up @@ -824,17 +824,9 @@ EOF
;;

drush)
root=/app
if [ -d $docker_compose_dir/web ]; then
root=/app/web
fi
if [ -e $docker_compose_dir/vendor/bin/drush.php ]; then
docker_compose exec phpfpm php /app/vendor/bin/drush.php --root=$root "$@"
elif [ -e $docker_compose_dir/vendor/bin/drush ]; then
docker_compose exec phpfpm /app/vendor/bin/drush --root=$root "$@"
else
docker_compose run --rm drush --root=$root "$@"
fi
# We use the `… phpfpm php vendor/bin/drush` to run Drush to make debugging (with Xdebug) work.
# Calling `… phpfpm vendor/bin/drush` somehow does not trigger a debugging session.
docker_compose exec phpfpm php vendor/bin/drush
;;

composer)
Expand Down