From a7e337b15328fa44f7c6261ac63975ea7bb60574 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sat, 20 Aug 2016 14:05:16 +0200 Subject: [PATCH] Fixed windows execution bug --- Utils/Git/Repository.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Utils/Git/Repository.php b/Utils/Git/Repository.php index c56655b97..f8d75ab4e 100644 --- a/Utils/Git/Repository.php +++ b/Utils/Git/Repository.php @@ -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'],