scripts: runner: let users copy/paste failed commands
Print a copy/pastable version of any command which fails, to help debugging. Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
This commit is contained in:
parent
ad8b006bf2
commit
57d5717bc6
|
@ -412,7 +412,11 @@ class ZephyrBinaryRunner(abc.ABC):
|
|||
'''
|
||||
if self.debug:
|
||||
print(quote_sh_list(cmd))
|
||||
subprocess.check_call(cmd)
|
||||
try:
|
||||
subprocess.check_call(cmd)
|
||||
except subprocess.CalledProcessError:
|
||||
print('Error running {}'.format(quote_sh_list(cmd)))
|
||||
raise
|
||||
|
||||
def check_output(self, cmd):
|
||||
'''Subclass subprocess.check_output() wrapper.
|
||||
|
@ -423,7 +427,11 @@ class ZephyrBinaryRunner(abc.ABC):
|
|||
'''
|
||||
if self.debug:
|
||||
print(quote_sh_list(cmd))
|
||||
return subprocess.check_output(cmd)
|
||||
try:
|
||||
return subprocess.check_output(cmd)
|
||||
except subprocess.CalledProcessError:
|
||||
print('Error running {}'.format(quote_sh_list(cmd)))
|
||||
raise
|
||||
|
||||
def popen_ignore_int(self, cmd):
|
||||
'''Spawn a child command, ensuring it ignores SIGINT.
|
||||
|
|
Loading…
Reference in a new issue