[damned-lies] Mark docs build as failed if yelp-build stderr has content



commit bf47a0eadd5dcaa9a0c81848ba037b42ccccd149
Author: Claude Paroz <claude 2xlibre net>
Date:   Sat Oct 6 14:42:15 2018 +0200

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

 vertimus/views.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/vertimus/views.py b/vertimus/views.py
index fff6c8ac..8d46b3f8 100644
--- a/vertimus/views.py
+++ b/vertimus/views.py
@@ -1,6 +1,7 @@
 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])


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]