| 1684 | } |
| 1685 | |
| 1686 | static void getFilesWithPrefixAndSuffix(const std::filesystem::path& folder, const std::string& prefix, const std::string& suffix, std::vector<std::filesystem::path>& result) { |
| 1687 | std::vector<std::filesystem::path> files; |
| 1688 | DFHack::Filesystem::listdir(folder, files); |
| 1689 | for ( const auto& f : files) { |
| 1690 | if (f.stem().string().starts_with(prefix) && f.extension() == suffix) |
| 1691 | result.push_back(f); |
| 1692 | } |
| 1693 | } |
| 1694 | |
| 1695 | size_t loadScriptFiles(Core* core, color_ostream& out, const std::span<const std::string> prefix, const std::filesystem::path& folder) { |
| 1696 | static const std::string suffix = ".init"; |