Skip to content

Commit

Permalink
Fix run-script not setting Path correctly on Windows (#10700)
Browse files Browse the repository at this point in the history
  • Loading branch information
xPaw committed Apr 6, 2022
1 parent 106149d commit c259879
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Composer/EventDispatcher/EventDispatcher.php
Expand Up @@ -571,7 +571,11 @@ protected function popEvent(): ?string
private function ensureBinDirIsInPath(): void
{
$pathEnv = 'PATH';
if (false === Platform::getEnv('PATH') && false !== Platform::getEnv('Path')) {

// checking if only Path and not PATH is set then we probably need to update the Path env
// on Windows getenv is case-insensitive so we cannot check it via Platform::getEnv and
// we need to check in $_SERVER directly
if (!isset($_SERVER[$pathEnv]) && isset($_SERVER['Path'])) {
$pathEnv = 'Path';
}

Expand Down

0 comments on commit c259879

Please sign in to comment.