This commit is contained in:
Nathan Thomas 2023-12-23 11:14:52 -08:00
parent 43710c6324
commit bde9f7adec

View file

@ -5,6 +5,7 @@ import os
import shutil import shutil
import subprocess import subprocess
from functools import wraps from functools import wraps
from typing import Any
import aiofiles import aiofiles
import click import click
@ -176,10 +177,10 @@ async def file(ctx, path):
async with Main(cfg) as main: async with Main(cfg) as main:
async with aiofiles.open(path, "r") as f: async with aiofiles.open(path, "r") as f:
try: try:
items = json.loads(await f.read()) items: Any = json.loads(await f.read())
loaded = True loaded = True
except json.JSONDecodeError: except json.JSONDecodeError:
items = [line async for line in f] items: Any = [line async for line in f]
loaded = False loaded = False
if loaded: if loaded:
console.print( console.print(