Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/OSTPlatform/Windows/DirectoryWatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ bool Watch::IssueRead() {
impl_->dir.get(),
impl_->buffer.data(),
static_cast<DWORD>(impl_->buffer.size()),
FALSE,
TRUE,
FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_LAST_WRITE,
&dummy,
&impl_->overlapped,
Expand Down
20 changes: 15 additions & 5 deletions src/Utils/Config/LuaConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -689,11 +689,21 @@ namespace LuaConfig{
if (!std::filesystem::exists(directory, ec) || !std::filesystem::is_directory(directory, ec))
return files;

for (const auto& entry : std::filesystem::directory_iterator(directory, ec)) {
if (ec) break;
if (!entry.is_regular_file()) continue;
if (entry.path().extension() != ".lua") continue;
files.push_back(entry.path().string());
std::vector<std::filesystem::path> pending = { std::filesystem::path(directory) };
while (!pending.empty()) {
std::filesystem::path current = pending.back();
pending.pop_back();

std::error_code dec;
for (const auto& entry : std::filesystem::directory_iterator(current, dec)) {
if (dec) break;
std::error_code fec;
if (entry.is_directory(fec)) {
pending.push_back(entry.path());
} else if (entry.is_regular_file(fec) && entry.path().extension() == ".lua") {
files.push_back(entry.path().string());
}
}
}
return files;
}
Expand Down