Fix: Expose error messages of subcommands.

This commit is contained in:
Manuel Barkhau 2019-03-29 01:20:43 +01:00
parent 6d3dc6dfcd
commit 20c5f9d103

View file

@ -14,6 +14,7 @@ import sys
import click
import logging
import typing as typ
import subprocess as sp
from . import vcs
from . import config
@ -346,7 +347,15 @@ def bump(
if dry:
return
try:
_bump(cfg, new_version, allow_dirty)
except sp.CalledProcessError as ex:
log.error(f"Error running subcommand: {ex.cmd}")
if ex.stdout:
sys.stdout.write(ex.stdout.decode('utf-8'))
if ex.stderr:
sys.stderr.write(ex.stderr.decode('utf-8'))
sys.exit(1)
if __name__ == '__main__':