0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-28 16:34:13 +01:00

modules/webroot: Check if webroot path exists on load.

This commit is contained in:
Jason Volk 2018-12-08 15:52:10 -08:00
parent 313bffffc2
commit 5d3f6bf79e

View file

@ -54,10 +54,24 @@ webroot_path
void void
init_files() init_files()
{ {
const std::string &path{webroot_path}; const std::string &path
{
webroot_path
};
if(empty(path)) if(empty(path))
return; return;
if(!fs::exists(path))
{
log::error
{
"Configured ircd.webroot.path at `%s' does not exist.", path
};
return;
}
for(const auto &file : fs::ls_recursive(path)) for(const auto &file : fs::ls_recursive(path))
{ {
const auto name(lstrip(file, path)); const auto name(lstrip(file, path));