fs: Fix paths on macOS

This commit is contained in:
WerWolv 2022-08-04 08:56:58 +02:00
parent 14150b5a04
commit c1da2497a7
1 changed files with 14 additions and 2 deletions

View File

@ -137,12 +137,24 @@ namespace hex::fs {
#endif #endif
for (auto &path : paths) { for (auto &path : paths) {
path = path / "imhex"; path = path / "imhex";
} }
if (auto executablePath = fs::getExecutablePath(); executablePath.has_value())
paths.push_back(executablePath->parent_path()); #if defined(OS_MACOS)
if (auto executablePath = fs::getExecutablePath(); executablePath.has_value())
paths.push_back(*executablePath);
#else
if (auto executablePath = fs::getExecutablePath(); executablePath.has_value())
paths.push_back(executablePath->parent_path());
#endif
auto additionalDirs = ImHexApi::System::getAdditionalFolderPaths(); auto additionalDirs = ImHexApi::System::getAdditionalFolderPaths();
std::copy(additionalDirs.begin(), additionalDirs.end(), std::back_inserter(paths)); std::copy(additionalDirs.begin(), additionalDirs.end(), std::back_inserter(paths));