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:
parent
313bffffc2
commit
5d3f6bf79e
1 changed files with 15 additions and 1 deletions
|
@ -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));
|
||||||
|
|
Loading…
Reference in a new issue