Fix type error when PATH env is not set, fixes #10662
parent
6bd75d5738
commit
0708eb45e5
|
@ -576,7 +576,7 @@ class EventDispatcher
|
||||||
$binDir = $this->composer->getConfig()->get('bin-dir');
|
$binDir = $this->composer->getConfig()->get('bin-dir');
|
||||||
if (is_dir($binDir)) {
|
if (is_dir($binDir)) {
|
||||||
$binDir = realpath($binDir);
|
$binDir = realpath($binDir);
|
||||||
$pathValue = Platform::getEnv($pathEnv);
|
$pathValue = (string) Platform::getEnv($pathEnv);
|
||||||
if (!Preg::isMatch('{(^|'.PATH_SEPARATOR.')'.preg_quote($binDir).'($|'.PATH_SEPARATOR.')}', $pathValue)) {
|
if (!Preg::isMatch('{(^|'.PATH_SEPARATOR.')'.preg_quote($binDir).'($|'.PATH_SEPARATOR.')}', $pathValue)) {
|
||||||
Platform::putEnv($pathEnv, $binDir.PATH_SEPARATOR.$pathValue);
|
Platform::putEnv($pathEnv, $binDir.PATH_SEPARATOR.$pathValue);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue