Coverage for src/prisma/cli/commands/fetch.py: 82%
9 statements
« prev ^ index » next coverage.py v7.2.7, created at 2024-08-27 18:25 +0000
« prev ^ index » next coverage.py v7.2.7, created at 2024-08-27 18:25 +0000
1import shutil
3import click
5from ... import config
6from ...cli.prisma import ensure_cached
9@click.command('fetch', short_help='Download all required binaries.')
10@click.option(
11 '--force',
12 is_flag=True,
13 help='Download all binaries regardless of if they are already downloaded or not.',
14)
15def cli(force: bool) -> None:
16 """Ensures all required binaries are available."""
17 if force: 17 ↛ 18line 17 didn't jump to line 18, because the condition on line 17 was never true
18 shutil.rmtree(config.binary_cache_dir)
20 directory = ensure_cached().cache_dir
21 click.echo(f'Downloaded binaries to {click.style(str(directory), fg="green")}')