fix git version detection on OSX
[phorkie.git] / src / phorkie / SetupCheck.php
index 69cffd8f073e7b200dfb861eeb1a92183f2858ce..c4d365c7a79552166aea7e88413f44ef0087f821 100644 (file)
@@ -24,8 +24,8 @@ class SetupCheck
     {
         $cfg = $GLOBALS['phorkie']['cfg'];
         $this->writableDirs = array(
-            'gitdir' => $cfg['gitdir'],
-            'workdir' => $cfg['workdir'],
+            'gitdir'  => Tools::foldPath($cfg['gitdir']),
+            'workdir' => Tools::foldPath($cfg['workdir']),
         );
         $this->elasticsearch = $cfg['elasticsearch'];
     }
@@ -48,9 +48,12 @@ class SetupCheck
     {
         foreach ($GLOBALS['phorkie']['cfgfiles'] as $file => $loaded) {
             if ($loaded) {
-                $this->ok('Loaded config file: ' . $file);
+                $this->ok('Loaded config file: ' . Tools::foldPath($file));
             } else {
-                $this->info('Possible config file: ' . $file . ' (not loaded)');
+                $this->info(
+                    'Possible config file: ' . Tools::foldPath($file)
+                    . ' (not loaded)'
+                );
             }
         }
     }
@@ -98,8 +101,9 @@ class SetupCheck
         if ($retval !== 0) {
             $this->fail('Running git executable failed.');
         }
-        if (!preg_match('#^git version ([0-9.]+(rc[0-9]+)?)$#', $line, $matches)) {
+        if (!preg_match('#^git version ([0-9.]+(rc[0-9]+)?)(?: \(Apple Git-\d+\))?$#', $line, $matches)) {
             $this->fail('git version output format unexpected: ' . $line);
+            return;
         }
         if (version_compare($matches[1], '1.7.5') < 0) {
             $this->fail(