From ca470ed4eedfc7c69227c2651b6671c270240466 Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Wed, 18 Sep 2019 17:27:47 +0200 Subject: [PATCH] Fixed version display in prerelease mode --- services/ApplicationService.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/services/ApplicationService.php b/services/ApplicationService.php index 27bc842c..d7604ef0 100644 --- a/services/ApplicationService.php +++ b/services/ApplicationService.php @@ -9,19 +9,15 @@ class ApplicationService extends BaseService { if ($this->InstalledVersion == null) { + $this->InstalledVersion = json_decode(file_get_contents(__DIR__ . '/../version.json')); + if (GROCY_MODE === 'prerelease') { $commitHash = trim(exec('git log --pretty="%h" -n1 HEAD')); $commitDate = trim(exec('git log --date=iso --pretty="%cd" -n1 HEAD')); - $this->InstalledVersion = array( - 'Version' => "pre-release-$commitHash", - 'ReleaseDate' => substr($commitDate, 0, 19) - ); - } - else - { - $this->InstalledVersion = json_decode(file_get_contents(__DIR__ . '/../version.json')); + $this->InstalledVersion->Version = "pre-release-$commitHash"; + $this->InstalledVersion->ReleaseDate = substr($commitDate, 0, 19); } }