Support dropping sh dependency
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Luke Murphy
2021-01-06 13:09:05 +01:00
parent 8e06794f3c
commit 781e7ec7bb
5 changed files with 49 additions and 70 deletions

View File

@ -12,13 +12,14 @@ LOG = logger.get_logger(__name__)
@pytest.helpers.register
def run_command(cmd, env=os.environ, log=True):
if log:
cmd = _rebake_command(cmd, env)
cmd = cmd.bake(_truncate_exc=False)
return util.run_command(cmd)
if cmd.__class__.__name__ == "Command":
if log:
cmd = _rebake_command(cmd, env)
cmd = cmd.bake(_truncate_exc=False)
return util.run_command(cmd, env=env)
def _rebake_command(cmd, env, out=LOG.out, err=LOG.error):
def _rebake_command(cmd, env, out=LOG.info, err=LOG.error):
return cmd.bake(_env=env, _out=out, _err=err)