Skip to content

Commit

Permalink
skip targets with invalid publication files (#638)
Browse files Browse the repository at this point in the history
* skip targets with invalid publication files

* formatting
  • Loading branch information
StevenClontz authored Nov 10, 2023
1 parent 3a530bd commit 84fbf3e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pretext/project/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1112,6 +1112,14 @@ class ProjectVersionOnly(pxml.BaseXmlModel, tag="project"):
d = tgt.model_dump()
del d["format"]

# Ensure publication file exists (necessary for v2 validation)
if not Path(tgt.publication).exists():
log.warning(
f"Publication file at {tgt.publication} does not exist."
)
log.warning(f"{tgt.name} will not be available.")
continue

# Remove the `None` from optional values, so the new format can replace these.
for key in ("site", "xsl", "latex_engine"):
if d[key] is None:
Expand Down

0 comments on commit 84fbf3e

Please sign in to comment.