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;
|
return $this->rootDir . 'vendor/bin/' . $bin;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use "which"
|
// Use "where" for windows and "which" for other OS
|
||||||
$which = trim(shell_exec('which ' . $bin));
|
$findCmd = (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') ? 'which' : 'where';
|
||||||
|
$findCmdResult = trim(shell_exec($findCmd . ' ' . $bin));
|
||||||
|
|
||||||
if (!empty($which)) {
|
if (!empty($findCmdResult)) {
|
||||||
return $which;
|
return $findCmdResult;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue