Pixel-Composer/scripts/version_checker/version_checker.gml
2025-01-19 09:52:22 +07:00

17 lines
No EOL
357 B
Text

function check_version(path, key = "version") {
if(!file_exists_empty(path)) {
var str = {};
str[$ key] = BUILD_NUMBER;
json_save_struct(path, str);
return true;
}
if(TESTING) return true;
var res = json_load_struct(path);
var chk = res[$ key] ?? 0;
res[$ key] = BUILD_NUMBER;
json_save_struct(path, res);
return chk != BUILD_NUMBER;
}