Pixel-Composer/scripts/version_checker/version_checker.gml

17 lines
357 B
Text
Raw Normal View History

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);
return true;
}
2024-04-08 14:52:24 +02:00
if(TESTING) return true;
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;
}