Use overriden composer bin-dir if it exists
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3508817. -->
Reported by: [dimitriskr](https://www.drupal.org/user/3575407)
Related to !423
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>A project might have a different bin-dir for its executables (phpcs/phpstan). Check if it exists in the project's composer and use this path for jobs<br>
<a href="https://getcomposer.org/doc/06-config.md#bin-dir">https://getcomposer.org/doc/06-config.md#bin-dir</a></p>
<h4 id="summary-steps-reproduce">Steps to reproduce</h4>
<p>Add the following to the composer.json of a project</p>
<pre> "config": {<br> "bin-dir": "custom/path/to/bin"<br> }</pre><p>Get the following error<br>
<code>sudo: vendor/bin/phpunit: command not found</code></p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<ol>
<li>Change scripts/expand_composer_json.php to check for this [no]</li>
<li>OR create a symlink to the custom path from ./vendor/bin [no]</li>
<li>OR create a variable to hold the full path to the custom directory [yes]</li>
</ol>
> Related issue: [Issue #3556609](https://www.drupal.org/node/3556609)
> Related issue: [Issue #3557341](https://www.drupal.org/node/3557341)
issue