summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorctolentino8 <ctolentino8@bloomberg.net>2019-10-02 13:45:00 +0100
committerctolentino8 <ctolentino8@bloomberg.net>2019-10-07 16:40:48 +0100
commit226e33d5ab1e7381428f80f066b66ed26fe993a5 (patch)
treecb6d66e9d30b98ac2959edc886846b0c5c4402db /doc
parent9405b6df2eb7ffc9cf55e8b0ee1283b55263fd38 (diff)
downloadbuildstream-226e33d5ab1e7381428f80f066b66ed26fe993a5.tar.gz
doc/bst2html.py: Error out if bst command in doc fails
Diffstat (limited to 'doc')
-rwxr-xr-xdoc/bst2html.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/doc/bst2html.py b/doc/bst2html.py
index b3204b8d8..cfaf05513 100755
--- a/doc/bst2html.py
+++ b/doc/bst2html.py
@@ -218,8 +218,11 @@ def run_bst_command(config_file, directory, command):
click.echo("Running bst command in directory '{}': bst {}".format(directory, command), err=True)
argv = ['python3', '-m', 'buildstream', '--colors', '--config', config_file] + shlex.split(command)
- p = subprocess.Popen(argv, cwd=directory, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
- out, _ = p.communicate()
+ try:
+ out = subprocess.check_output(argv, cwd=directory, stderr=subprocess.STDOUT)
+ except subprocess.CalledProcessError as e:
+ click.echo("Command failed:\n{}".format(e.output.decode('utf-8').strip()))
+ sys.exit(1)
return out.decode('utf-8').strip()