Set app version on install and updates

This commit is contained in:
Darko Gjorgjijoski
2024-08-01 19:39:47 +02:00
parent a64701bda5
commit f82937e85e
4 changed files with 24 additions and 0 deletions

View File

@@ -2,7 +2,9 @@
namespace App\Space;
use App\Models\Setting;
use Illuminate\Database\QueryException;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Log;
use League\Flysystem\FilesystemException;
@@ -89,4 +91,18 @@ class InstallUtils
return false;
}
/**
* Set the app version
*
* @return void
*/
public static function setCurrentVersion()
{
$version = preg_replace('~[\r\n]+~', '', File::get(base_path('version.md')));
if (! $version) {
return;
}
Setting::setSetting('version', $version);
}
}