update file library warnings

This commit is contained in:
MihailRis
2024-11-19 10:04:26 +03:00
parent c543575150
commit a015d74af5
2 changed files with 11 additions and 3 deletions
+4 -3
View File
@@ -57,11 +57,12 @@ static fs::path get_writeable_path(lua::State* L) {
fs::path path = resolve_path(rawpath);
auto entryPoint = rawpath.substr(0, rawpath.find(':'));
if (writeable_entry_points.find(entryPoint) == writeable_entry_points.end()) {
lua::emit_event(L, "core:warning", [=](auto L) {
if (lua::getglobal(L, "__vc_warning")) {
lua::pushstring(L, "writing to read-only entry point");
lua::pushstring(L, entryPoint);
return 2;
});
lua::pushinteger(L, 1);
lua::call_nothrow(L, 3);
}
}
return path;
}