Fixed composer plugin for using on Windows

This commit is contained in:
Corpsee 2014-03-09 00:30:32 +07:00
parent ffc7d1c1b9
commit c3b9e62adf

View file

@ -45,8 +45,11 @@ class Composer implements \PHPCI\Plugin
$this->phpci->logFailure('Could not find Composer.');
return false;
}
$cmd = $composerLocation . ' --no-ansi --no-interaction ';
$cmd = '';
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
$cmd = 'php ';
}
$cmd .= $composerLocation . ' --no-ansi --no-interaction ';
$cmd .= ($this->preferDist ? '--prefer-dist' : null) . ' --working-dir="%s" %s';
return $this->phpci->executeCommand($cmd, $this->directory, $this->action);