Assume version is vDev if not on master branch

This removes the need for a vDev tag, which was less reliable
because it needed to be the most recent tag in the dev branch and
was really just an sign that the repo was on a branch besides
master.
This commit is contained in:
Mcat12
2016-12-08 17:20:39 -05:00
parent eeb8811738
commit e9a7c2f5f7
+14 -2
View File
@@ -5,8 +5,20 @@
<footer class="main-footer">
<div class="pull-right hidden-xs">
<?php
$piholeVersion = exec("cd /etc/.pihole/ && git describe --tags --abbrev=0");
$webVersion = exec("git describe --tags --abbrev=0");
// Check if on a dev branch
$piholeVersion = exec("cd /etc/.pihole/ && git rev-parse --abbrev-ref HEAD");
$webVersion = exec("git rev-parse --abbrev-ref HEAD");
// Use vDev if not on master
if($piholeVersion !== "master")
$piholeVersion = "vDev";
else
$piholeVersion = exec("cd /etc/.pihole/ && git describe --tags --abbrev=0");
if($webVersion !== "master")
$webVersion = "vDev";
else
$webVersion = exec("git describe --tags --abbrev=0");
?>
<b>Pi-hole Version </b> <span id="piholeVersion"><?php echo $piholeVersion; ?></span>
<b>Web Interface Version </b> <span id="webVersion"><?php echo $webVersion; ?></span>