noggit3
noggit3 copied to clipboard
Return nil when read_file not found file
trafficstars
I think we can add return nil or something like that here :
https://github.com/wowdev/noggit3/blob/74309b7cd33e19ae2b9e69160612d98eae3b8dcc/src/noggit/scripting/script_filesystem.cpp#L35
And in script we can now use read_file like that :
local myFile = read_file(path)
if ( myFile ) then
...
end
if (!fs::exists(path))
{
//throw script_exception("read_file","no such file:" + std::string (path));
return false;
}
you have this: https://github.com/wowdev/noggit3/blob/default/scripts/docs/api/modules.md#path_exists
but could probably make two differentiating files and folders as well.
i see this too late, lol