From 942b89a5aaaa94d999bd0defe423dbeb2fa9f796 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20L=C3=B3pez?= Date: Wed, 9 Oct 2024 19:18:26 +0200 Subject: [PATCH] Added pre-composer command to replace composer if there is a vendor version --- config.aljibe.yaml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/config.aljibe.yaml b/config.aljibe.yaml index 07a340c..edf9878 100644 --- a/config.aljibe.yaml +++ b/config.aljibe.yaml @@ -1,3 +1,10 @@ +# Custom config to alter composer executable in case Drupal is defining a custom version. +# See https://github.com/ddev/ddev/issues/6602 for more details. hooks: - post-start: - - exec: test -f /var/www/html/vendor/bin/composer && rm -f /usr/local/bin/composer && ln -s /var/www/html/vendor/bin/composer /usr/local/bin/composer + pre-composer: + - exec: | + if [ -f /var/www/html/vendor/bin/composer ] && \ + [ "$(readlink /usr/local/bin/composer)" != "/var/www/html/vendor/bin/composer" ]; then \ + rm -f /usr/local/bin/composer && \ + ln -s /var/www/html/vendor/bin/composer /usr/local/bin/composer; \ + fi \ No newline at end of file