mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 01:32:38 +00:00
Use current commit hash as version "number" when MODE is prerelease
This commit is contained in:
parent
037d024862
commit
8d41dcc650
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
# Either "production" or "dev"
|
||||
# Either "production", "dev" or "prerelease"
|
||||
Setting('MODE', 'production');
|
||||
|
||||
# Either "en" or "de" or the filename (without extension) of
|
||||
|
@ -17,9 +17,18 @@ class BaseController
|
||||
|
||||
$applicationService = new ApplicationService();
|
||||
$versionInfo = $applicationService->GetInstalledVersion();
|
||||
$container->view->set('version', $versionInfo->Version);
|
||||
$container->view->set('releaseDate', $versionInfo->ReleaseDate);
|
||||
|
||||
if (GROCY_MODE === 'prerelease')
|
||||
{
|
||||
$commitHash = trim(exec('git log --pretty="%h" -n1 HEAD'));
|
||||
$container->view->set('version', "pre-release-$commitHash");
|
||||
}
|
||||
else
|
||||
{
|
||||
$container->view->set('version', $versionInfo->Version);
|
||||
}
|
||||
|
||||
$container->view->set('localizationStrings', $localizationService->GetCurrentCultureLocalizations());
|
||||
$container->view->set('L', function($text, ...$placeholderValues) use($localizationService)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user