don't setup json inventory for cli users

This commit is contained in:
Jörg Thalheim
2024-07-22 06:19:06 +02:00
parent f04ed457db
commit 05a28e596d

View File

@@ -32,6 +32,7 @@ class CreateOptions:
meta: Meta | None = None meta: Meta | None = None
# URL to the template to use. Defaults to the "minimal" template # URL to the template to use. Defaults to the "minimal" template
template: str = "minimal" template: str = "minimal"
setup_json_inventory: bool = True
def git_command(directory: Path, *args: str) -> list[str]: def git_command(directory: Path, *args: str) -> list[str]:
@@ -87,6 +88,7 @@ def create_clan(options: CreateOptions) -> CreateClanResponse:
) )
# Write inventory.json file # Write inventory.json file
if options.setup_json_inventory:
inventory = load_inventory(directory) inventory = load_inventory(directory)
if options.meta is not None: if options.meta is not None:
inventory.meta = options.meta inventory.meta = options.meta
@@ -133,8 +135,7 @@ def register_create_parser(parser: argparse.ArgumentParser) -> None:
def create_flake_command(args: argparse.Namespace) -> None: def create_flake_command(args: argparse.Namespace) -> None:
create_clan( create_clan(
CreateOptions( CreateOptions(
directory=args.path, directory=args.path, template=args.template, setup_json_inventory=False
template=args.template,
) )
) )