mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-05-13 16:37:27 +00:00
Better error message when ripgrep is not found
This commit is contained in:
parent
24eeeedb1f
commit
de12dddbef
1 changed files with 4 additions and 1 deletions
|
|
@ -23,7 +23,10 @@ def main() -> None:
|
|||
if not sys.stdout.isatty() and '--pretty' not in sys.argv:
|
||||
os.execlp('rg', 'rg', *sys.argv[1:])
|
||||
cmdline = ['rg', '--pretty', '--with-filename'] + sys.argv[1:]
|
||||
p = subprocess.Popen(cmdline, stdout=subprocess.PIPE)
|
||||
try:
|
||||
p = subprocess.Popen(cmdline, stdout=subprocess.PIPE)
|
||||
except FileNotFoundError:
|
||||
raise SystemExit('Could not find the rg executable in your PATH. Is ripgrep installed?')
|
||||
assert p.stdout is not None
|
||||
write: Callable[[bytes], None] = cast(Callable[[bytes], None], sys.stdout.buffer.write)
|
||||
sgr_pat = re.compile(br'\x1b\[.*?m')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue