Skip to content

Commit 5f53089

Browse files
authored
Skip writing file if redirect is broken (#38)
1 parent f4f9f0f commit 5f53089

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

sphinxext/rediraffe.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,12 +242,14 @@ def build_redirects(app: Sphinx, exception: Union[Exception, None]) -> None:
242242
f'{yellow("(broken)")} {redirect_from} redirects to {redirect_to} but {build_redirect_from} already exists!'
243243
)
244244
app.statuscode = 1
245+
continue
245246

246247
if not build_redirect_to.exists():
247248
logger.warning(
248249
f'{yellow("(broken)")} {redirect_from} redirects to {redirect_to} but {build_redirect_to} does not exist!'
249250
)
250251
app.statuscode = 1
252+
continue
251253

252254
build_redirect_from.parent.mkdir(parents=True, exist_ok=True)
253255
with build_redirect_from.open("w") as f:

0 commit comments

Comments
 (0)