1
0
Fork 0
mirror of https://github.com/hyprwm/Hyprland synced 2025-04-13 10:38:02 +02:00

versionkeeper: create version file if not present ()

This commit is contained in:
Armin 2025-04-02 22:21:05 +02:00 committed by GitHub
parent a4e6c5d678
commit 8654029f86
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -26,10 +26,12 @@ CVersionKeeperManager::CVersionKeeperManager() {
if (!DATAROOT)
return;
const auto LASTVER = NFsUtils::readFileAsString(*DATAROOT + "/" + VERSION_FILE_NAME);
auto LASTVER = NFsUtils::readFileAsString(*DATAROOT + "/" + VERSION_FILE_NAME);
if (!LASTVER)
return;
if (!LASTVER) {
NFsUtils::writeToFile(*DATAROOT + "/" + VERSION_FILE_NAME, "0.0.0");
LASTVER = "0.0.0";
}
if (!isVersionOlderThanRunning(*LASTVER)) {
Debug::log(LOG, "CVersionKeeperManager: Read version {} matches or is older than running.", *LASTVER);