feat(cli): Adding the -f flag to install command

This commit is contained in:
Karim shoair
2025-03-05 03:32:43 +02:00
parent 087a85d615
commit f8662bee29
+3 -2
View File
@@ -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')