From ac1e9f3650efcd0da5164feb26338e811db6d38b Mon Sep 17 00:00:00 2001 From: Jimmy MA Date: Tue, 27 Aug 2024 16:11:09 +0800 Subject: [PATCH] Update refresh-compile-commands.py --- refresh-compile-commands.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/refresh-compile-commands.py b/refresh-compile-commands.py index d918921..c231946 100755 --- a/refresh-compile-commands.py +++ b/refresh-compile-commands.py @@ -49,15 +49,16 @@ def _build_file_content(content, targets): """ -def _run_shell_command_with_live_output(cmd, cwd, check=True): +def _run_shell_command_with_live_output(cmd, cwd, shell=True): print(cmd) - p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd=cwd) + p = subprocess.Popen( + cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd=cwd, shell=shell + ) for line in p.stdout: print(line.decode("utf-8").rstrip()) p.wait() status = p.poll() - if check: - assert status == 0 + assert status == 0 def _rm(path: str): p = pathlib.Path(path)