diff --git a/scrapling/cli.py b/scrapling/cli.py index be2c257..58ad43c 100644 --- a/scrapling/cli.py +++ b/scrapling/cli.py @@ -17,8 +17,9 @@ def run_command(command, line): @click.command(help="Install all Scrapling's Fetchers dependencies") -def install(): - if not get_package_dir().joinpath(".scrapling_dependencies_installed").exists(): +@click.option('-f', '--force', 'force', is_flag=True, default=False, type=bool, help="Force Scrapling to reinstall all Fetchers dependencies") +def install(force): + if force or not get_package_dir().joinpath(".scrapling_dependencies_installed").exists(): run_command([sys.executable, "-m", "playwright", "install", 'chromium'], 'Playwright browsers') run_command([sys.executable, "-m", "playwright", "install-deps", 'chromium', 'firefox'], 'Playwright dependencies') run_command([sys.executable, "-m", "camoufox", "fetch", '--browserforge'], 'Camoufox browser and databases')