From 84e6b8272f3aee24251da231ae0e043d3cd12cf3 Mon Sep 17 00:00:00 2001 From: Jesper Skytte Marcussen Date: Tue, 4 Apr 2023 21:54:45 +0200 Subject: [PATCH] Extra bin-dir lookup feature The Composer bin-dir path is usually changed by setting the composer config `bin-dir`, but another common way of doing it is, if the vendor directory itself is moved by changing the `vendor-dir` configuration. --- src/Util/ComposerFile.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Util/ComposerFile.php b/src/Util/ComposerFile.php index 74cb62287..dc8545f32 100644 --- a/src/Util/ComposerFile.php +++ b/src/Util/ComposerFile.php @@ -29,6 +29,12 @@ public function getBinDir(): string if (null !== $binDir) { return (string) $binDir; } + + $binDir = $this->configuration['config']['vendor-dir'] ?? null; + + if (null !== $binDir) { + return (string) $binDir . '/bin'; + } return 'vendor/bin'; }