mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-22 10:55:18 -04:00
Add ripgrep configs
This commit is contained in:
parent
ebc5a2bd3c
commit
24d4c44624
2 changed files with 13 additions and 2 deletions
|
@ -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")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue