Explicit full path for OpenComposite search

This commit is contained in:
Patrick Nicolas
2024-11-30 17:15:07 +01:00
parent 2cca89bd6e
commit cf55ff9b3a
2 changed files with 4 additions and 4 deletions
+2 -3
View File
@@ -48,12 +48,11 @@ std::filesystem::path active_runtime::manifest_path()
std::filesystem::path active_runtime::opencomposite_path()
{
std::filesystem::path OpenComposite = "OpenComposite";
if (auto path = flatpak_key(flatpak::section::instance, "app-path"))
return *path / OpenComposite;
return std::filesystem::path(*path) / "OpenComposite";
for (auto path: std::ranges::split_view(std::string_view(OPENCOMPOSITE_SEARCH_PATH), std::string_view(":")))
{
if (auto res = std::string_view(path) / OpenComposite; std::filesystem::exists(res))
if (auto res = std::string_view(path); std::filesystem::exists(res))
return res;
}
return {};