Skip to content

Commit 3bd4017

Browse files
committed
Tentatively fixed #299
1 parent 950b451 commit 3bd4017

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/shared/Version.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,23 @@ private function initialize() {
7979
if (!is_dir(__DIR__ . '/../../.git') || strpos(ini_get('disable_functions'), 'exec') !== false) {
8080
return $this->release;
8181
}
82+
8283
$dir = getcwd();
8384
chdir(__DIR__);
8485

85-
$devNull = strtolower(substr(PHP_OS, 0, 3)) == 'win' ? 'nul' : '/dev/null';
86-
$git = exec('command -p git describe --always --dirty 2>'.$devNull, $foo, $rc);
86+
$devNull = '/dev/null';
87+
$cmd = 'command -p git';
88+
if (strtolower(substr(PHP_OS, 0, 3)) === 'win') {
89+
$devNull = 'nul';
90+
$cmd = 'git.exe';
91+
}
92+
93+
$git = exec($cmd . ' describe --always --dirty 2>'.$devNull, $foo, $rc);
8794
chdir($dir);
8895
if ($rc === 0) {
8996
return $git;
9097
}
98+
9199
return $this->release;
92100
}
93101
}

0 commit comments

Comments
 (0)