diff --git a/PHPCI/Helper/CommandExecutor.php b/PHPCI/Helper/CommandExecutor.php index 60061404..5c64dd45 100644 --- a/PHPCI/Helper/CommandExecutor.php +++ b/PHPCI/Helper/CommandExecutor.php @@ -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; } }