From a7ecefb5a009aabc2189322b84dfcb3c0d35dc04 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Fri, 23 Jun 2023 21:39:39 +0200 Subject: [PATCH] fix: Don't load constants files that start with a `_` --- plugins/builtin/source/content/views/view_constants.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/builtin/source/content/views/view_constants.cpp b/plugins/builtin/source/content/views/view_constants.cpp index f3b978a3a..47facc325 100644 --- a/plugins/builtin/source/content/views/view_constants.cpp +++ b/plugins/builtin/source/content/views/view_constants.cpp @@ -30,6 +30,9 @@ namespace hex::plugin::builtin { for (auto &file : std::fs::directory_iterator(path, error)) { if (!file.is_regular_file()) continue; + if (file.path().extension() != ".json") continue; + if (file.path().filename().u8string().starts_with('_')) continue; + try { auto fileData = wolv::io::File(file.path(), wolv::io::File::Mode::Read).readString(); auto content = nlohmann::json::parse(fileData);