lib: minor manifest reading fixes

fixes #29
This commit is contained in:
Vaxry 2024-04-08 18:20:04 +01:00
parent 65507c093f
commit af4ce3953d
1 changed files with 7 additions and 9 deletions

View File

@ -141,12 +141,11 @@ static std::string getFullPathForThemeName(const std::string& name, PHYPRCURSORL
continue;
}
if (!std::filesystem::exists(MANIFESTPATH))
continue;
CManifest manifest{MANIFESTPATH};
if (!manifest.parse().has_value())
if (const auto R = manifest.parse(); R.has_value()) {
Debug::log(HC_LOG_ERR, logfn, "failed parsing Manifest of {}: {}", themeDir.path().string(), *R);
continue;
}
const std::string NAME = manifest.parsedData.name;
@ -177,12 +176,11 @@ static std::string getFullPathForThemeName(const std::string& name, PHYPRCURSORL
const auto MANIFESTPATH = themeDir.path().string() + "/manifest";
if (std::filesystem::exists(MANIFESTPATH + ".hl") || std::filesystem::exists(MANIFESTPATH + ".toml"))
continue;
CManifest manifest{MANIFESTPATH};
if (!manifest.parse().has_value())
CManifest manifest{MANIFESTPATH};
if (const auto R = manifest.parse(); R.has_value()) {
Debug::log(HC_LOG_ERR, logfn, "failed parsing Manifest of {}: {}", themeDir.path().string(), *R);
continue;
}
const std::string NAME = manifest.parsedData.name;