make sure that flake url is always set in the cli
This commit is contained in:
@@ -33,8 +33,11 @@ async def inspect_vm(flake_url: str | Path, flake_attr: str) -> VmConfig:
|
|||||||
|
|
||||||
|
|
||||||
def inspect_command(args: argparse.Namespace) -> None:
|
def inspect_command(args: argparse.Namespace) -> None:
|
||||||
clan_dir = Path(args.flake)
|
if args.flake is None:
|
||||||
res = asyncio.run(inspect_vm(flake_url=clan_dir, flake_attr=args.machine))
|
flake = Path.cwd()
|
||||||
|
else:
|
||||||
|
flake = Path(args.flake)
|
||||||
|
res = asyncio.run(inspect_vm(flake_url=flake, flake_attr=args.machine))
|
||||||
print("Cores:", res.cores)
|
print("Cores:", res.cores)
|
||||||
print("Memory size:", res.memory_size)
|
print("Memory size:", res.memory_size)
|
||||||
print("Graphics:", res.graphics)
|
print("Graphics:", res.graphics)
|
||||||
|
|||||||
@@ -270,6 +270,8 @@ def run_vm(
|
|||||||
|
|
||||||
def run_command(args: argparse.Namespace) -> None:
|
def run_command(args: argparse.Namespace) -> None:
|
||||||
flake_url = args.flake_url or args.flake
|
flake_url = args.flake_url or args.flake
|
||||||
|
if not flake_url:
|
||||||
|
flake_url = Path.cwd()
|
||||||
vm = asyncio.run(inspect_vm(flake_url=flake_url, flake_attr=args.machine))
|
vm = asyncio.run(inspect_vm(flake_url=flake_url, flake_attr=args.machine))
|
||||||
|
|
||||||
run_vm(vm, args.option)
|
run_vm(vm, args.option)
|
||||||
|
|||||||
Reference in New Issue
Block a user