Skip to content

Commit

Permalink
Set the state.toml filename based upon --select-output (#206)
Browse files Browse the repository at this point in the history
Co-authored-by: Hugo van Kemenade <[email protected]>
  • Loading branch information
AA-Turner and hugovk authored Oct 1, 2024
1 parent caa4a29 commit be14d95
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions build_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,10 @@ def should_rebuild(self):
return False

def load_state(self) -> dict:
state_file = self.build_root / "state.toml"
if self.select_output is not None:
state_file = self.build_root / f"state-{self.select_output}.toml"
else:
state_file = self.build_root / "state.toml"
try:
return tomlkit.loads(state_file.read_text(encoding="UTF-8"))[
f"/{self.language.tag}/{self.version.name}/"
Expand All @@ -950,7 +953,10 @@ def save_state(self, build_start: dt, build_duration: float, trigger: str):
Using this we can deduce if a rebuild is needed or not.
"""
state_file = self.build_root / "state.toml"
if self.select_output is not None:
state_file = self.build_root / f"state-{self.select_output}.toml"
else:
state_file = self.build_root / "state.toml"
try:
states = tomlkit.parse(state_file.read_text(encoding="UTF-8"))
except FileNotFoundError:
Expand Down

0 comments on commit be14d95

Please sign in to comment.