diff options
author | ctolentino8 <ctolentino8@bloomberg.net> | 2019-10-02 13:45:00 +0100 |
---|---|---|
committer | ctolentino8 <ctolentino8@bloomberg.net> | 2019-10-07 16:40:48 +0100 |
commit | 226e33d5ab1e7381428f80f066b66ed26fe993a5 (patch) | |
tree | cb6d66e9d30b98ac2959edc886846b0c5c4402db | |
parent | 9405b6df2eb7ffc9cf55e8b0ee1283b55263fd38 (diff) | |
download | buildstream-226e33d5ab1e7381428f80f066b66ed26fe993a5.tar.gz |
doc/bst2html.py: Error out if bst command in doc fails
-rwxr-xr-x | doc/bst2html.py | 7 |
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() |