Add ripgrep configs

This commit is contained in:
jdcaballerov 2020-12-12 07:36:31 -05:00
parent ebc5a2bd3c
commit 24d4c44624
2 changed files with 13 additions and 2 deletions

View file

@ -2,7 +2,7 @@ import re
from subprocess import run, PIPE, DEVNULL
from typing import List, Generator
from archivebox.config import ARCHIVE_DIR
from archivebox.config import ARCHIVE_DIR, RIPGREP_BINARY
from archivebox.util import enforce_types
RG_IGNORE_EXTENSIONS = ('css','js','orig','svg')
@ -26,7 +26,7 @@ def flush(snapshot_ids: Generator[str, None, None]):
@enforce_types
def search(text: str) -> List[str]:
is_rg_installed = run(['which', 'rg'], stdout=DEVNULL, stderr=DEVNULL)
is_rg_installed = run(['which', RIPGREP_BINARY], stdout=DEVNULL, stderr=DEVNULL)
if is_rg_installed.returncode:
raise Exception("ripgrep binary not found, install ripgrep to use this search backend")