clan-cli: Add update_clan boolean option to create_clan

This commit is contained in:
Qubasa
2025-02-10 12:38:29 +07:00
parent 8baff4637e
commit a8fa8f505c

View File

@@ -37,6 +37,7 @@ class CreateOptions:
input_prio: InputPrio | None = None
setup_git: bool = True
initial: Inventory | None = None
update_clan: bool = True
def git_command(directory: Path, *args: str) -> list[str]:
@@ -96,10 +97,11 @@ def create_clan(opts: CreateOptions) -> CreateClanResponse:
git_command(dest, "config", "user.email", "clan@example.com")
)
flake_update = run(
nix_shell(["nixpkgs#nix"], ["nix", "flake", "update"]), RunOpts(cwd=dest)
)
response.flake_update = flake_update
if opts.update_clan:
flake_update = run(
nix_shell(["nixpkgs#nix"], ["nix", "flake", "update"]), RunOpts(cwd=dest)
)
response.flake_update = flake_update
if opts.initial:
init_inventory(str(opts.dest), init=opts.initial)