diff --git a/bench/utils.py b/bench/utils.py index 10a25988..c37b0806 100755 --- a/bench/utils.py +++ b/bench/utils.py @@ -28,6 +28,7 @@ class color: green = '\033[92m' yellow = '\033[93m' red = '\033[91m' + silver = '\033[90m' def is_bench_directory(directory=os.path.curdir): @@ -172,26 +173,11 @@ def clone_apps_from(bench_path, clone_from, update_app=True): setup_app(app) def exec_cmd(cmd, cwd='.'): - from .cli import from_command_line - - is_async = False if from_command_line else True - if is_async: - stderr = stdout = subprocess.PIPE - else: - stderr = stdout = None - + import shlex logger.info(cmd) - - p = subprocess.Popen(cmd, cwd=cwd, shell=True, stdout=stdout, stderr=stderr, - universal_newlines=True) - - if is_async: - return_code = print_output(p) - else: - return_code = p.wait() - - if return_code > 0: - raise CommandFailedError(cmd) + cmd = shlex.split(cmd) + print("{0}$ {1}{2}".format(color.silver, cmd, color.nc)) + subprocess.call(cmd, cwd=cwd, universal_newlines=True) def which(executable, raise_err = False): from distutils.spawn import find_executable