From aa53f4f088bd5eca63db394d71597c32cdcb9d6c Mon Sep 17 00:00:00 2001 From: jdcaballerov <743513+jdcaballerov@users.noreply.github.com> Date: Sat, 12 Dec 2020 08:36:01 -0500 Subject: [PATCH] Update archivebox/search/backends/ripgrep.py Co-authored-by: Nick Sweeting --- archivebox/search/backends/ripgrep.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/archivebox/search/backends/ripgrep.py b/archivebox/search/backends/ripgrep.py index b37eca20..b6532bfd 100644 --- a/archivebox/search/backends/ripgrep.py +++ b/archivebox/search/backends/ripgrep.py @@ -26,8 +26,7 @@ def flush(snapshot_ids: Generator[str, None, None]): @enforce_types def search(text: str) -> List[str]: - is_rg_installed = run(['which', RIPGREP_BINARY], stdout=DEVNULL, stderr=DEVNULL) - if is_rg_installed.returncode: + if not RIPGREP_VERSION: raise Exception("ripgrep binary not found, install ripgrep to use this search backend") from core.models import Snapshot @@ -44,4 +43,3 @@ def search(text: str) -> List[str]: snap_ids = [str(id) for id in Snapshot.objects.filter(timestamp__in=timestamps).values_list('pk', flat=True)] return snap_ids -