diff --git a/src/version.php b/src/version.php index 3c03528e..633b4cd3 100644 --- a/src/version.php +++ b/src/version.php @@ -28,6 +28,7 @@ $branch = trim(exec("hash git 2>/dev/null && cd $path >/dev/null 2>&1 && git branch --no-color 2>/dev/null | sed -e '/^[^*]/d' -e \"s/* \(.*\)/\\1/\"")); $version = exec("hash git 2>/dev/null && cd $path >/dev/null 2>&1 && git describe --always 2>/dev/null"); $file = dirname(realpath($_SERVER['SCRIPT_FILENAME'])) . '/version'; + $fileparent = dirname(realpath($_SERVER['SCRIPT_FILENAME'])) . '/../version'; if ($branch && $version) { define("ZPUSH_VERSION", $branch .'-'. $version); } @@ -35,7 +36,11 @@ $line = fgets(fopen($file, 'r')); define("ZPUSH_VERSION", $line); } + elseif (file_exists($fileparent)) { + $line = fgets(fopen($fileparent, 'r')); + define("ZPUSH_VERSION", $line); + } else { define("ZPUSH_VERSION", "GIT"); } -} \ No newline at end of file +}