clan: add run_no_stdout function suppressing stdout

Add the `run_no_stdout` function suppressing stdout by default.
This keeps the noise down on most commands, while still staying
debuggable.
Stdout will be active when the `--debug` flag is passed to the cli.

Fixes #1443
This commit is contained in:
a-kenji
2024-05-27 21:52:18 +02:00
parent dbaa26ccaa
commit 8a08c00f46
12 changed files with 53 additions and 41 deletions

View File

@@ -2,7 +2,7 @@ import json
from pathlib import Path
from typing import Any
from ..cmd import run
from ..cmd import run_no_stdout
from ..errors import ClanError
from ..nix import nix_eval
@@ -32,7 +32,7 @@ def schema_from_module_file(
"""
# run the nix expression and parse the output as json
cmd = nix_eval(["--expr", nix_expr])
proc = run(cmd)
proc = run_no_stdout(cmd)
return json.loads(proc.stdout)