execute_command 在非 verbose 模式下捕获 stdout 后直接 return None, 导致 git status --porcelain 等命令的输出被丢弃。 现在成功时若有 stdout 则打印到终端, 保留失败时的 stderr 信息。
This commit is contained in:
@@ -90,6 +90,8 @@ def run_command(spec: TaskSpec[Any]) -> Any: # noqa: PLR0912
|
||||
print(f"[verbose] 返回码: {result.returncode}", flush=True)
|
||||
|
||||
if result.returncode == 0:
|
||||
if not verbose and result.stdout:
|
||||
print(result.stdout, end="", flush=True)
|
||||
return None
|
||||
|
||||
err_msg = f"{label}执行失败: `{cmd_str}`, 返回码: {result.returncode}"
|
||||
|
||||
Reference in New Issue
Block a user