feat(cli): Adding the -f flag to install command
This commit is contained in:
+3
-2
@@ -17,8 +17,9 @@ def run_command(command, line):
|
|||||||
|
|
||||||
|
|
||||||
@click.command(help="Install all Scrapling's Fetchers dependencies")
|
@click.command(help="Install all Scrapling's Fetchers dependencies")
|
||||||
def install():
|
@click.option('-f', '--force', 'force', is_flag=True, default=False, type=bool, help="Force Scrapling to reinstall all Fetchers dependencies")
|
||||||
if not get_package_dir().joinpath(".scrapling_dependencies_installed").exists():
|
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", 'chromium'], 'Playwright browsers')
|
||||||
run_command([sys.executable, "-m", "playwright", "install-deps", 'chromium', 'firefox'], 'Playwright dependencies')
|
run_command([sys.executable, "-m", "playwright", "install-deps", 'chromium', 'firefox'], 'Playwright dependencies')
|
||||||
run_command([sys.executable, "-m", "camoufox", "fetch", '--browserforge'], 'Camoufox browser and databases')
|
run_command([sys.executable, "-m", "camoufox", "fetch", '--browserforge'], 'Camoufox browser and databases')
|
||||||
|
|||||||
Reference in New Issue
Block a user