Karim shoair commited on
Commit
a19f085
·
1 Parent(s): 40c3918

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

Browse files
Files changed (1) hide show
  1. scrapling/cli.py +3 -2
scrapling/cli.py CHANGED
@@ -17,8 +17,9 @@ def run_command(command, line):
17
 
18
 
19
  @click.command(help="Install all Scrapling's Fetchers dependencies")
20
- def install():
21
- if not get_package_dir().joinpath(".scrapling_dependencies_installed").exists():
 
22
  run_command([sys.executable, "-m", "playwright", "install", 'chromium'], 'Playwright browsers')
23
  run_command([sys.executable, "-m", "playwright", "install-deps", 'chromium', 'firefox'], 'Playwright dependencies')
24
  run_command([sys.executable, "-m", "camoufox", "fetch", '--browserforge'], 'Camoufox browser and databases')
 
17
 
18
 
19
  @click.command(help="Install all Scrapling's Fetchers dependencies")
20
+ @click.option('-f', '--force', 'force', is_flag=True, default=False, type=bool, help="Force Scrapling to reinstall all Fetchers dependencies")
21
+ def install(force):
22
+ if force or not get_package_dir().joinpath(".scrapling_dependencies_installed").exists():
23
  run_command([sys.executable, "-m", "playwright", "install", 'chromium'], 'Playwright browsers')
24
  run_command([sys.executable, "-m", "playwright", "install-deps", 'chromium', 'firefox'], 'Playwright dependencies')
25
  run_command([sys.executable, "-m", "camoufox", "fetch", '--browserforge'], 'Camoufox browser and databases')