return just the base on config not found

This commit is contained in:
Mihai Fufezan 2024-07-09 19:52:26 +03:00
parent e73ddfe051
commit a5afa58175
Signed by: fufexan
SSH key fingerprint: SHA256:SdnKmEpJrDu1+2UO1QpB/Eg4HKcdDi6n+xSRqFNJVpg

View file

@ -48,12 +48,16 @@ namespace Hyprutils::Path {
if (xdgConfigHome.has_value()) {
if (checkConfigExists(xdgConfigHome.value(), programName))
return std::make_pair(fullConfigPath(xdgConfigHome.value(), programName), xdgConfigHome);
else
return std::make_pair(std::nullopt, xdgConfigHome);
}
static const auto home = getHome();
if (home.has_value()) {
if (checkConfigExists(home.value(), programName))
return std::make_pair(fullConfigPath(home.value(), programName), home);
else
return std::make_pair(std::nullopt, home);
}
static const auto xdgConfigDirs = getXdgConfigDirs();