Skip to content

Commit be14d95

Browse files
AA-Turnerhugovk
andauthored
Set the state.toml filename based upon --select-output (#206)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
1 parent caa4a29 commit be14d95

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

build_docs.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -937,7 +937,10 @@ def should_rebuild(self):
937937
return False
938938

939939
def load_state(self) -> dict:
940-
state_file = self.build_root / "state.toml"
940+
if self.select_output is not None:
941+
state_file = self.build_root / f"state-{self.select_output}.toml"
942+
else:
943+
state_file = self.build_root / "state.toml"
941944
try:
942945
return tomlkit.loads(state_file.read_text(encoding="UTF-8"))[
943946
f"/{self.language.tag}/{self.version.name}/"
@@ -950,7 +953,10 @@ def save_state(self, build_start: dt, build_duration: float, trigger: str):
950953
951954
Using this we can deduce if a rebuild is needed or not.
952955
"""
953-
state_file = self.build_root / "state.toml"
956+
if self.select_output is not None:
957+
state_file = self.build_root / f"state-{self.select_output}.toml"
958+
else:
959+
state_file = self.build_root / "state.toml"
954960
try:
955961
states = tomlkit.parse(state_file.read_text(encoding="UTF-8"))
956962
except FileNotFoundError:

0 commit comments

Comments
 (0)