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

View file

@ -141,12 +141,11 @@ static std::string getFullPathForThemeName(const std::string& name, PHYPRCURSORL
continue; continue;
} }
if (!std::filesystem::exists(MANIFESTPATH))
continue;
CManifest manifest{MANIFESTPATH}; 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; continue;
}
const std::string NAME = manifest.parsedData.name; 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"; const auto MANIFESTPATH = themeDir.path().string() + "/manifest";
if (std::filesystem::exists(MANIFESTPATH + ".hl") || std::filesystem::exists(MANIFESTPATH + ".toml"))
continue;
CManifest manifest{MANIFESTPATH}; 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; continue;
}
const std::string NAME = manifest.parsedData.name; const std::string NAME = manifest.parsedData.name;