Skip .wms files that start with "." or "_"

This commit is contained in:
Maschell 2022-10-03 22:02:52 +02:00
parent 9979eddc60
commit 28cefca560
2 changed files with 9 additions and 0 deletions

View File

@ -56,6 +56,11 @@ void doStart(int argc, char **argv) {
DirList modules(basePath + "/modules", ".wms", DirList::Files, 1);
modules.SortList();
for (int i = 0; i < modules.GetFilecount(); i++) {
std::string_view asView(modules.GetFilename(i));
if (asView.starts_with('.') || asView.starts_with('_')) {
DEBUG_FUNCTION_LINE_WARN("Skip file %s", modules.GetFilename(i));
continue;
}
DEBUG_FUNCTION_LINE("Loading module %s", modules.GetFilepath(i));
auto moduleData = ModuleDataFactory::load(modules.GetFilepath(i));
if (moduleData) {

View File

@ -36,6 +36,8 @@ extern "C" {
#define DEBUG_FUNCTION_LINE_ERR(FMT, ARGS...) LOG_EX(WHBLogPrintf, "##ERROR## ", "", FMT, ##ARGS)
#define DEBUG_FUNCTION_LINE_WARN(FMT, ARGS...) LOG_EX(WHBLogPrintf, "##WARN ## ", "", FMT, ##ARGS)
#else
#define DEBUG_FUNCTION_LINE_VERBOSE(FMT, ARGS...) while (0)
@ -46,6 +48,8 @@ extern "C" {
#define DEBUG_FUNCTION_LINE_ERR(FMT, ARGS...) LOG_EX(OSReport, "##ERROR## ", "\n", FMT, ##ARGS)
#define DEBUG_FUNCTION_LINE_WARN(FMT, ARGS...) LOG_EX(OSReport, "##WARN ## ", "\n", FMT, ##ARGS)
#endif
void initLogging();