Skip to content

Commit

Permalink
Extra bin-dir lookup feature
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
greew authored Apr 4, 2023
1 parent d600fc6 commit 84e6b82
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Util/ComposerFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
Expand Down

0 comments on commit 84e6b82

Please sign in to comment.