parameterize dump images step to work with custom data paths

This commit is contained in:
Viktor Barzin 2025-05-14 21:01:58 +00:00
parent e424361ed9
commit 07fef7fbab
No known key found for this signature in database
GPG key ID: 4056458DBDBF8863
3 changed files with 19 additions and 9 deletions

View file

@ -66,9 +66,12 @@ def dump_detail(ctx: click.core.Context):
@cli.command()
def dump_images():
click.echo('Running dump_images')
dump_images_module.dump_images()
@click.pass_context
def dump_images(ctx: click.core.Context):
data_dir = ctx.obj['data_dir']
click.echo(f'Running dump_images stored in {data_dir}')
listing_paths = sorted(list(pathlib.Path(data_dir).glob("*/listing.json")))
dump_images_module.dump_images(listing_paths)
@cli.command()