Skip to content

Commit

Permalink
use (executable-find "rg") instead of assuming "rg" is in path
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolamontecchio authored and dajva committed Mar 13, 2018
1 parent 2641353 commit a351685
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions rg.el
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,9 @@ a string describing how the process finished.")
(defvar rg-builtin-type-aliases nil
"Cache for 'rg --type-list'.")

(defvar rg-command "rg --color always --colors match:fg:red -n"
(defvar rg-command
(concat (executable-find "rg")
" --color always --colors match:fg:red -n")
"Command string for invoking rg.")

(defvar rg-last-search nil
Expand Down Expand Up @@ -375,7 +377,8 @@ added as a '--type-add' parameter to the rg command line."
(s-trim
(mapconcat 'identity (split-string (cadr association) "," t ) " ")))))
(nbutlast (split-string
(shell-command-to-string "rg --type-list") "\n") 1)))
(shell-command-to-string
(concat (executable-find "rg") " --type-list")) "\n") 1)))


(defun rg-get-type-aliases (&optional nospecial)
Expand Down

0 comments on commit a351685

Please sign in to comment.