mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-20 18:59:07 -05:00
fix: write no export its validator refuses
validate() ran after the files were written, so an export the exporter's own validator refused still replaced the published one in exports/, and only the exit code said so. The platform now fails before anything is cleared or written.
This commit is contained in:
1 parent
49b79a6d52
commit
f758efd062
2 files changed
+39
-5
No files matched your search
@@ -552,6 +552,13 @@ def export_platform(
|
||||
return False, ["the exporter produced no file"]
|
||||
|
||||
issues = exporter.validate(systems, produced)
|
||||
if issues:
|
||||
# Written first, a file its own validator refused replaced the
|
||||
# published export and only the exit code said so.
|
||||
invalid = [f"INVALID: {issue}" for issue in issues[:10]]
|
||||
if len(issues) > 10:
|
||||
invalid.append(f"and {len(issues) - 10} more validation failures")
|
||||
return False, invalid
|
||||
|
||||
platform_dir = output_dir / platform
|
||||
_remove_stale(platform_dir, set(produced))
|
||||
@@ -628,10 +635,6 @@ def export_platform(
|
||||
if len(cleared) > 5:
|
||||
messages.append(f"and {len(cleared) - 5} more cleared")
|
||||
|
||||
messages.extend(f"INVALID: {issue}" for issue in issues[:10])
|
||||
if len(issues) > 10:
|
||||
messages.append(f"and {len(issues) - 10} more validation failures")
|
||||
|
||||
write_report(output_dir / f"{platform}.json", {
|
||||
"platform": platform,
|
||||
"originals": wanted_sources(exporter, systems, scraped),
|
||||
@@ -652,7 +655,7 @@ def export_platform(
|
||||
"withheld": list(withheld),
|
||||
"invalid": issues,
|
||||
})
|
||||
return not issues, messages
|
||||
return True, messages
|
||||
|
||||
|
||||
def write_report(path: Path, report: dict) -> None:
|
||||
|
||||
Reference in new issue
Block a user