More interactive verbose calls
This commit is contained in:
parent
37e14a1abe
commit
741231af89
12
hererocks.py
12
hererocks.py
@ -51,18 +51,20 @@ def space_cat(*args):
|
|||||||
|
|
||||||
def run_command(verbose, *args):
|
def run_command(verbose, *args):
|
||||||
command = space_cat(*args)
|
command = space_cat(*args)
|
||||||
|
runner = subprocess.check_output
|
||||||
|
|
||||||
if verbose:
|
if verbose:
|
||||||
print("Running " + command)
|
print("Running " + command)
|
||||||
|
runner = subprocess.check_call
|
||||||
|
|
||||||
try:
|
try:
|
||||||
output = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True)
|
runner(command, stderr=subprocess.STDOUT, shell=True)
|
||||||
except subprocess.CalledProcessError as exception:
|
except subprocess.CalledProcessError as exception:
|
||||||
sys.exit("Error: got exitcode {} from command {}\nOutput:\n{}".format(
|
if not verbose:
|
||||||
exception.returncode, command, exception.output))
|
sys.stdout.write(exception.output)
|
||||||
|
|
||||||
if verbose and output:
|
sys.exit("Error: got exitcode {} from command {}\n".format(
|
||||||
sys.stdout.write(output)
|
exception.returncode, command))
|
||||||
|
|
||||||
lua_versions = ([
|
lua_versions = ([
|
||||||
"5.1", "5.1.1", "5.1.2", "5.1.3", "5.1.4", "5.1.5",
|
"5.1", "5.1.1", "5.1.2", "5.1.3", "5.1.4", "5.1.5",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user