Merge "Provide mvn command output when VERBOSE set" into stable-2.14

This commit is contained in:
David Pursehouse 2018-02-07 23:20:24 +00:00 committed by Gerrit Code Review
commit 315542d4d9
1 changed files with 3 additions and 1 deletions

View File

@ -16,7 +16,7 @@
from __future__ import print_function
from optparse import OptionParser
from os import path, environ
from subprocess import check_output
from subprocess import check_output, CalledProcessError
from sys import stderr
opts = OptionParser()
@ -67,6 +67,8 @@ for spec in args.s:
except Exception as e:
print('%s command failed: %s\n%s' % (args.a, ' '.join(exe), e),
file=stderr)
if environ.get('VERBOSE') and isinstance(e, CalledProcessError):
print('Command output\n%s' % e.output, file=stderr)
exit(1)