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