Inventory: add load_eval method
This commit is contained in:
@@ -6,7 +6,7 @@ from pathlib import Path
|
||||
|
||||
from clan_cli.api import API
|
||||
from clan_cli.arg_actions import AppendOptionAction
|
||||
from clan_cli.inventory import Meta, load_inventory, save_inventory
|
||||
from clan_cli.inventory import Meta, load_inventory_json, save_inventory
|
||||
|
||||
from ..cmd import CmdOut, run
|
||||
from ..errors import ClanError
|
||||
@@ -89,7 +89,7 @@ def create_clan(options: CreateOptions) -> CreateClanResponse:
|
||||
)
|
||||
|
||||
# Write inventory.json file
|
||||
inventory = load_inventory(directory)
|
||||
inventory = load_inventory_json(directory)
|
||||
if options.meta is not None:
|
||||
inventory.meta = options.meta
|
||||
# Persist creates a commit message for each change
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from dataclasses import dataclass
|
||||
|
||||
from clan_cli.api import API
|
||||
from clan_cli.inventory import Meta, load_inventory, save_inventory
|
||||
from clan_cli.inventory import Meta, load_inventory_json, save_inventory
|
||||
|
||||
|
||||
@dataclass
|
||||
@@ -12,7 +12,7 @@ class UpdateOptions:
|
||||
|
||||
@API.register
|
||||
def update_clan_meta(options: UpdateOptions) -> Meta:
|
||||
inventory = load_inventory(options.directory)
|
||||
inventory = load_inventory_json(options.directory)
|
||||
inventory.meta = options.meta
|
||||
|
||||
save_inventory(inventory, options.directory, "Update clan metadata")
|
||||
|
||||
Reference in New Issue
Block a user