Fixed handling of relative paths in configuration files (#69)

This commit is contained in:
Bartek Kryza
2023-01-21 18:00:21 +01:00
parent b3701fa810
commit 78cfa630e5
99 changed files with 221 additions and 207 deletions

View File

@@ -317,4 +317,17 @@ std::string path_to_url(const std::filesystem::path &p)
return fmt::format("{}", fmt::join(path_tokens, "/"));
}
std::filesystem::path ensure_path_is_absolute(
const std::filesystem::path &p, const std::filesystem::path &root)
{
if (p.is_absolute())
return p;
auto result = root / p;
result = result.lexically_normal();
result.make_preferred();
return result;
}
} // namespace clanguml::util