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:
@@ -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)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user