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