Skip to content

Commit

Permalink
make the executable resolution more generic
Browse files Browse the repository at this point in the history
Suggested-by: Michiel Borkent <[email protected]>
#247 (comment)
  • Loading branch information
agzam committed Dec 7, 2024
1 parent b0be3e5 commit 1ace493
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions neil.el
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,17 @@ Otherwise uses the given value."
(defun neil--find-exe ()
"Returns absolute path to neil executable."
(if-let* ((exe (cond
;; it should work for `neil-executable-path' values like:
;; "clj -M:neil" or "bb -Sdeps '...' -m babashka.neil"
;; as well as simple: "neil" or "neil-cmd" likes.
((and (stringp neil-executable-path)
(string-match "^\\(clj\\|clojure\\)\\s-" neil-executable-path))
(string-match "^\\([^ ]+\\)\\s-" neil-executable-path))
(replace-regexp-in-string
"^\\(clj\\|clojure\\)"
"^\\([^ ]+\\)"
(executable-find (match-string 1 neil-executable-path))
neil-executable-path))
(t (executable-find (or neil-executable-path "neil"))))))
exe (user-error "Cannot find 'neil' executable. Ensure either 'neil', or 'clojure|clj' with :neil alias is available")))
exe (user-error "Cannot find executable set in 'neil-executable-path'")))

;;;###autoload
(defun neil-find-clojure-package (&optional term)
Expand Down

0 comments on commit 1ace493

Please sign in to comment.