1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-04 23:33:14 +02:00

Add self-test to module manager for those who rm -rf their source directory.

This commit is contained in:
Bram Matthys
2020-11-28 11:31:31 +01:00
parent 7a3876e7b2
commit 7002139fad
+22
View File
@@ -1643,11 +1643,33 @@ void mm_parse_c_file(int argc, char *args[])
exit(0);
}
void mm_self_test(void)
{
char name[512];
snprintf(name, sizeof(name), "%s/src/modules/third", BUILDDIR);
if (file_exists(name))
return;
if (!file_exists(BUILDDIR))
{
fprintf(stderr, "ERROR: Directory %s does not exist.\n"
"The UnrealIRCd source is required for the module manager to work!\n",
BUILDDIR);
} else {
fprintf(stderr, "ERROR: Directory %s exists, but %s does not.\n"
"The UnrealIRCd source is required for the module manager to work.\n"
"It seems you only have a partial build directory??\n",
BUILDDIR, name);
}
exit(-1);
}
void modulemanager(int argc, char *args[])
{
if (!args[0])
mm_usage();
mm_self_test();
/* The following operations do not require reading
* of the repository list and are always available:
*/