Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search phpstan executable from exec-path #151

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions phpactor.el
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,18 @@ of GitHub.")

(defun phpactor--find-executable ()
"Return path to Phpactor executable file."
(let ((vendor-executable (f-join phpactor-install-directory "vendor/bin/phpactor")))
(if (file-exists-p vendor-executable)
vendor-executable
(warn "Phpactor not found. Please run `phpactor-install-or-update' command")
nil)))
(let* (target
(vendor-executable
(cond
((progn
(setq target (f-join phpactor-install-directory "vendor/bin/phpactor"))
(file-executable-p target))
target)
((setq target (executable-find "phpactor"))
target))))
(unless vendor-executable
(warn "Phpactor not found. Please run `phpactor-install-or-update' command"))
vendor-executable))

(defcustom phpactor-executable (phpactor--find-executable)
"Path to phpactor executable.
Expand Down