patch for SunOS

corrected collection of switch version during detect_switch
This commit is contained in:
Matthew Vale
2015-12-11 14:57:14 +00:00
parent 5a0d25ff06
commit fdd1542b66
2 changed files with 7 additions and 4 deletions

View File

@@ -87,11 +87,13 @@ $document['title'] = $text['title-sys-status'];
$git_path = normalize_path_to_os($_SERVER["DOCUMENT_ROOT"]."/.git");
if(file_exists($git_path)){
$git_branch = shell_exec('git --git-dir='.$git_path.' name-rev --name-only HEAD');
$git_exe = 'git';
if (strtoupper(substr(PHP_OS, 0, 3)) === 'SUN') { $git_exe = shell_exec('which git')); }
$git_branch = shell_exec($git_exe.' --git-dir='.$git_path.' name-rev --name-only HEAD');
rtrim($git_branch);
$git_commit = shell_exec('git --git-dir='.$git_path.' rev-parse HEAD');
$git_commit = shell_exec($git_exe.' --git-dir='.$git_path.' rev-parse HEAD');
rtrim($git_commit);
$git_origin = shell_exec('git --git-dir='.$git_path.' config --get remote.origin.url');
$git_origin = shell_exec($git_exe.' --git-dir='.$git_path.' config --get remote.origin.url');
rtrim($git_commit);
echo "<tr>\n";
echo " <td width='20%' class=\"vncell\" style='text-align: left;'>\n";