Use consistent fallback for missing/malformed lists

This commit is contained in:
mtkennerly 2024-06-30 18:59:27 -04:00
parent cec1c7eadc
commit 1186370d5a
No known key found for this signature in database
GPG key ID: E764BE00BE6E6408
2 changed files with 9 additions and 2 deletions

View file

@ -22,5 +22,12 @@ pub fn save_missing_games(wiki_cache: &WikiCache, manifest: &Manifest, overrides
.map(|(k, v)| format!("* [{}](https://www.pcgamingwiki.com/wiki/?curid={})", k, v.page_id))
.collect();
_ = std::fs::write(format!("{}/data/missing.md", REPO), lines.join("\n") + "\n");
_ = std::fs::write(
format!("{}/data/missing.md", REPO),
if lines.is_empty() {
"N/A".to_string()
} else {
lines.join("\n") + "\n"
},
);
}

View file

@ -1123,7 +1123,7 @@ pub fn save_malformed_list(wiki_cache: &WikiCache) {
_ = std::fs::write(
format!("{}/data/wiki-malformed.md", crate::REPO),
if lines.is_empty() {
"* No errors found".to_string()
"N/A".to_string()
} else {
lines.join("\n") + "\n"
},