clan-cli: cmd.run now has its options extracted to a dataclass

This commit is contained in:
Qubasa
2024-11-28 15:26:37 +01:00
parent a5d52a2a65
commit 1f98df96e3
31 changed files with 218 additions and 180 deletions

View File

@@ -8,7 +8,7 @@ from pathlib import Path
from tempfile import TemporaryDirectory
from typing import TYPE_CHECKING, Any
from clan_cli.cmd import run
from clan_cli.cmd import RunOpts, run
from clan_cli.completions import (
add_dynamic_completer,
complete_machines,
@@ -192,10 +192,7 @@ def execute_generator(
cmd = bubblewrap_cmd(generator.final_script, tmpdir)
else:
cmd = ["bash", "-c", generator.final_script]
run(
cmd,
env=env,
)
run(cmd, RunOpts(env=env))
files_to_commit = []
# store secrets
files = generator.files

View File

@@ -6,7 +6,7 @@ from itertools import chain
from pathlib import Path
from typing import override
from clan_cli.cmd import Log, run
from clan_cli.cmd import Log, RunOpts, run
from clan_cli.machines.machines import Machine
from clan_cli.nix import nix_shell
from clan_cli.vars.generate import Generator, Var
@@ -50,8 +50,7 @@ class SecretStore(SecretStoreBase):
str(self.entry_dir(generator, var.name)),
],
),
input=value,
check=True,
RunOpts(input=value, check=True),
)
return None # we manage the files outside of the git repo
@@ -88,7 +87,7 @@ class SecretStore(SecretStoreBase):
self.entry_prefix,
],
),
check=False,
RunOpts(check=False),
)
.stdout.strip()
.encode()
@@ -116,7 +115,7 @@ class SecretStore(SecretStoreBase):
str(symlink),
],
),
check=False,
RunOpts(check=False),
)
.stdout.strip()
.encode()