Merge pull request 'make sure that flake url is always set in the cli' (#618) from Mic92-main into main
All checks were successful
assets1 / test (push) Successful in 21s
checks-impure / test (push) Successful in 1m7s
checks / test (push) Successful in 2m0s

This commit is contained in:
clan-bot 2023-12-08 10:07:50 +00:00
commit 01291c55c1
2 changed files with 7 additions and 2 deletions

View File

@ -33,8 +33,11 @@ async def inspect_vm(flake_url: str | Path, flake_attr: str) -> VmConfig:
def inspect_command(args: argparse.Namespace) -> None:
clan_dir = Path(args.flake)
res = asyncio.run(inspect_vm(flake_url=clan_dir, flake_attr=args.machine))
if args.flake is None:
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("Memory size:", res.memory_size)
print("Graphics:", res.graphics)

View File

@ -270,6 +270,8 @@ def run_vm(
def run_command(args: argparse.Namespace) -> None:
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))
run_vm(vm, args.option)