Output error if command fails
This commit is contained in:
parent
1284f3f092
commit
0414ff4cc3
1 changed files with 17 additions and 11 deletions
|
@ -32,17 +32,23 @@ def rst2html(i, o):
|
||||||
)
|
)
|
||||||
|
|
||||||
def run_through_template(input):
|
def run_through_template(input):
|
||||||
null = open(os.devnull, 'w')
|
tmpfile = './tmp/output'
|
||||||
subprocess.check_output(
|
try:
|
||||||
[
|
with open(tmpfile, 'w') as out:
|
||||||
'python', 'build.py',
|
subprocess.check_output(
|
||||||
"-i", "matrix_templates",
|
[
|
||||||
"-o", "../scripts/tmp",
|
'python', 'build.py',
|
||||||
"../scripts/"+input
|
"-i", "matrix_templates",
|
||||||
],
|
"-o", "../scripts/tmp",
|
||||||
stderr=null,
|
"../scripts/"+input
|
||||||
cwd="../templating",
|
],
|
||||||
)
|
stderr=out,
|
||||||
|
cwd="../templating",
|
||||||
|
)
|
||||||
|
except subprocess.CalledProcessError as e:
|
||||||
|
with open(tmpfile, 'r') as f:
|
||||||
|
print f.read()
|
||||||
|
raise
|
||||||
|
|
||||||
def prepare_env():
|
def prepare_env():
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue