Fixed findBinary function for windows (which -> where)

This commit is contained in:
Dmitry Khomutov 2014-03-09 00:30:00 +07:00
parent d8a4273f01
commit 1497f96b01

View file

@ -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;
}
}