2025-01-19 03:52:22 +01:00
|
|
|
function check_version(path, key = "version") {
|
2023-12-08 03:50:09 +01:00
|
|
|
if(!file_exists_empty(path)) {
|
2025-01-19 03:52:22 +01:00
|
|
|
var str = {};
|
|
|
|
str[$ key] = BUILD_NUMBER;
|
|
|
|
json_save_struct(path, str);
|
2023-11-18 03:47:11 +01:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2024-04-08 14:52:24 +02:00
|
|
|
if(TESTING) return true;
|
2023-11-18 11:49:25 +01:00
|
|
|
|
2023-11-18 03:47:11 +01:00
|
|
|
var res = json_load_struct(path);
|
2025-01-19 03:52:22 +01:00
|
|
|
var chk = res[$ key] ?? 0;
|
|
|
|
res[$ key] = BUILD_NUMBER;
|
|
|
|
json_save_struct(path, res);
|
2023-12-11 09:59:58 +01:00
|
|
|
|
2025-01-19 03:52:22 +01:00
|
|
|
return chk != BUILD_NUMBER;
|
2023-11-18 03:47:11 +01:00
|
|
|
}
|