Skip to content

Commit

Permalink
Merge pull request #350 from Laupetin/fix/not-loading-iwd
Browse files Browse the repository at this point in the history
fix: not loading iwds from search-path in Unlinker
  • Loading branch information
Laupetin authored Jan 15, 2025
2 parents 64bac44 + a41d15d commit aa73dca
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/Unlinker/UnlinkerPaths.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,23 @@ bool UnlinkerPaths::LoadUserPaths(const UnlinkerArgs& args)
auto searchPathName = absolutePath.string();
m_user_paths.CommitSearchPath(std::make_unique<SearchPathFilesystem>(searchPathName));
m_specified_user_paths.emplace(std::move(searchPathName));

std::filesystem::directory_iterator iterator(absolutePath);
const auto end = fs::end(iterator);
for (auto i = fs::begin(iterator); i != end; ++i)
{
if (!i->is_regular_file())
continue;

auto extension = i->path().extension().string();
utils::MakeStringLowerCase(extension);
if (extension == ".iwd")
{
auto iwd = iwd::LoadFromFile(i->path().string());
if (iwd)
m_user_paths.CommitSearchPath(std::move(iwd));
}
}
}

std::cout << std::format("{} SearchPaths{}\n", m_specified_user_paths.size(), !m_specified_user_paths.empty() ? ":" : "");
Expand Down

0 comments on commit aa73dca

Please sign in to comment.