Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 06b4b83

Browse files
AA-Turnerhugovk
andauthoredOct 1, 2024··
Invert condition
Co-authored-by: Hugo van Kemenade <[email protected]>
1 parent 47b2956 commit 06b4b83

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed
 

‎build_docs.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -929,10 +929,10 @@ def should_rebuild(self):
929929
return False
930930

931931
def load_state(self) -> dict:
932-
if self.select_output is None:
933-
state_file = self.build_root / "state.toml"
934-
else:
932+
if self.select_output is not None:
935933
state_file = self.build_root / f"state-{self.select_output}.toml"
934+
else:
935+
state_file = self.build_root / "state.toml"
936936
try:
937937
return tomlkit.loads(state_file.read_text(encoding="UTF-8"))[
938938
f"/{self.language.tag}/{self.version.name}/"
@@ -945,10 +945,10 @@ def save_state(self, build_start: dt, build_duration: float, trigger: str):
945945
946946
Using this we can deduce if a rebuild is needed or not.
947947
"""
948-
if self.select_output is None:
949-
state_file = self.build_root / "state.toml"
950-
else:
948+
if self.select_output is not None:
951949
state_file = self.build_root / f"state-{self.select_output}.toml"
950+
else:
951+
state_file = self.build_root / "state.toml"
952952
try:
953953
states = tomlkit.parse(state_file.read_text(encoding="UTF-8"))
954954
except FileNotFoundError:

0 commit comments

Comments
 (0)
Please sign in to comment.