Fixed findBinary function for windows (which -> where)
This commit is contained in:
parent
d8a4273f01
commit
1497f96b01
|
@ -118,11 +118,12 @@ class CommandExecutor
|
|||
return $this->rootDir . 'vendor/bin/' . $bin;
|
||||
}
|
||||
|
||||
// Use "which"
|
||||
$which = trim(shell_exec('which ' . $bin));
|
||||
// Use "where" for windows and "which" for other OS
|
||||
$findCmd = (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') ? 'which' : 'where';
|
||||
$findCmdResult = trim(shell_exec($findCmd . ' ' . $bin));
|
||||
|
||||
if (!empty($which)) {
|
||||
return $which;
|
||||
if (!empty($findCmdResult)) {
|
||||
return $findCmdResult;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue