File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments