Commit bf47a0ea authored by Claude Paroz's avatar Claude Paroz

Mark docs build as failed if yelp-build stderr has content

parent 78295f22
import difflib
import os
import re
import shutil
import subprocess
import tempfile
from pathlib import Path
......@@ -359,13 +360,14 @@ class BuildTranslatedDocsView(PoFileActionBase):
*build_ref
]
result = subprocess.run(cmd, cwd=str(build_dir), stderr=subprocess.PIPE)
if result.returncode != 0:
index_html = html_dir / 'index.html'
if result.returncode != 0 or (not index_html.exists() and len(result.stderr)):
shutil.rmtree(str(html_dir))
return build_error % {
'program': 'yelp-build', 'err': result.stderr.decode()
}
if not (html_dir / 'index.html').exists():
if not index_html.exists():
# Create an index.html symlink to the base html doc if needed
try:
doc = parse(build_ref[0])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment