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