Refactor subprocess to cmd.py part 2

This commit is contained in:
Qubasa
2024-01-03 14:25:34 +01:00
parent 4a69912667
commit ba05589af2
7 changed files with 18 additions and 35 deletions

View File

@@ -1,8 +1,8 @@
import json
import subprocess
from pathlib import Path
from typing import Any
from ..cmd import run
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 = subprocess.run(cmd, stdout=subprocess.PIPE, check=True)
proc = run(cmd)
return json.loads(proc.stdout)