Added OS specific lookup commands
This resolved my issue on OSX and should clear up any issues on Windows. Will need confirmation from a Windows user though. Closes #2
This commit is contained in:
parent
adf9a5bdef
commit
c1adcad92a
1 changed files with 9 additions and 1 deletions
|
@ -62,8 +62,16 @@ class ClosureCompiler
|
||||||
*/
|
*/
|
||||||
public function getBinary()
|
public function getBinary()
|
||||||
{
|
{
|
||||||
|
if (PHP_OS == 'Darwin') {
|
||||||
|
$command = 'whereis';
|
||||||
|
} elseif (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {
|
||||||
|
$command = 'where';
|
||||||
|
} else {
|
||||||
|
$command = 'which';
|
||||||
|
}
|
||||||
|
|
||||||
if (!$this->java) {
|
if (!$this->java) {
|
||||||
$this->java = rtrim(shell_exec('which java'));
|
$this->java = rtrim(shell_exec($command . ' java'));
|
||||||
if (!$this->java) {
|
if (!$this->java) {
|
||||||
throw new \RuntimeException('java could not be found in PATH.');
|
throw new \RuntimeException('java could not be found in PATH.');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue