From 05a28e596d9889ed5e0181613e6937254f5dfb8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Mon, 22 Jul 2024 06:19:06 +0200 Subject: [PATCH] don't setup json inventory for cli users --- pkgs/clan-cli/clan_cli/clan/create.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pkgs/clan-cli/clan_cli/clan/create.py b/pkgs/clan-cli/clan_cli/clan/create.py index 3e43e70c7..154854c8b 100644 --- a/pkgs/clan-cli/clan_cli/clan/create.py +++ b/pkgs/clan-cli/clan_cli/clan/create.py @@ -32,6 +32,7 @@ class CreateOptions: meta: Meta | None = None # URL to the template to use. Defaults to the "minimal" template template: str = "minimal" + setup_json_inventory: bool = True def git_command(directory: Path, *args: str) -> list[str]: @@ -87,11 +88,12 @@ def create_clan(options: CreateOptions) -> CreateClanResponse: ) # Write inventory.json file - inventory = load_inventory(directory) - if options.meta is not None: - inventory.meta = options.meta - # Persist creates a commit message for each change - save_inventory(inventory, directory, "Init inventory") + if options.setup_json_inventory: + inventory = load_inventory(directory) + if options.meta is not None: + inventory.meta = options.meta + # Persist creates a commit message for each change + save_inventory(inventory, directory, "Init inventory") flake_update = run( nix_shell(["nixpkgs#nix"], ["nix", "flake", "update"]), cwd=directory @@ -133,8 +135,7 @@ def register_create_parser(parser: argparse.ArgumentParser) -> None: def create_flake_command(args: argparse.Namespace) -> None: create_clan( CreateOptions( - directory=args.path, - template=args.template, + directory=args.path, template=args.template, setup_json_inventory=False ) )