print exist status
This commit is contained in:
@@ -60,7 +60,12 @@ def clean_cache(directory: Path):
|
|||||||
shutil.rmtree(directory)
|
shutil.rmtree(directory)
|
||||||
|
|
||||||
|
|
||||||
def run(command: str | Sequence[str], verbose: bool, cwd: Path | None = None) -> None:
|
def run(
|
||||||
|
command: str | Sequence[str],
|
||||||
|
verbose: bool,
|
||||||
|
cwd: Path | None = None,
|
||||||
|
check: bool = False,
|
||||||
|
) -> None:
|
||||||
"""Run command in a subprocess"""
|
"""Run command in a subprocess"""
|
||||||
# pylint: disable=subprocess-run-check
|
# pylint: disable=subprocess-run-check
|
||||||
# This toggle allows for a really wasy debug when using -v
|
# This toggle allows for a really wasy debug when using -v
|
||||||
@@ -77,7 +82,9 @@ def run(command: str | Sequence[str], verbose: bool, cwd: Path | None = None) ->
|
|||||||
else:
|
else:
|
||||||
args = list(command)
|
args = list(command)
|
||||||
|
|
||||||
subprocess.run(args, check=False, cwd=cwd)
|
result = subprocess.run(args, check=check, cwd=cwd)
|
||||||
|
if not check and result.returncode != 0:
|
||||||
|
LOG.warning("Command failed (%s): %s", result.returncode, args)
|
||||||
|
|
||||||
|
|
||||||
def list_lines(i: int, line: str) -> str:
|
def list_lines(i: int, line: str) -> str:
|
||||||
|
|||||||
Reference in New Issue
Block a user