mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 17:45:39 +00:00
Fixed version display in prerelease mode
This commit is contained in:
parent
2237e2f8f4
commit
ca470ed4ee
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user