Fixed windows execution bug

This commit is contained in:
Dennis Eichhorn 2016-08-20 14:05:16 +02:00
parent a02f1cca5d
commit a7e337b153

View File

@ -177,7 +177,12 @@ class Repository
*/
private function run(string $cmd) : array
{
$cmd = escapeshellarg(Git::getBin()) . ' ' . $cmd;
if (strtolower(substr(PHP_OS, 0, 3)) == 'win') {
$cmd = 'cd ' . escapeshellarg(dirname(Git::getBin())) . ' && ' . basename(Git::getBin()) . ' -C ' . escapeshellarg($this->path) . ' ' . $cmd;
} else {
$cmd = escapeshellarg(Git::getBin()) . ' -C ' . escapeshellarg($this->path) . ' ' . $cmd;
}
$pipes = [];
$desc = [
1 => ['pipe', 'w'],