Skip to content

Commit 1ca4885

Browse files
committed
Add phpactor-ensure-executable command/function
1 parent 193e27b commit 1ca4885

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

phpactor.el

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,13 @@ have to ensure a compatible version of phpactor is used."
133133
(prog1
134134
(setq phpactor-executable (phpactor--find-executable))
135135
(remove-hook 'compilation-finish-functions #'phpactor-reset-executable)))
136+
137+
(defun phpactor-ensure-executable ()
138+
"Ensure `phpactor' command installed."
139+
(interactive)
140+
(unless (and phpactor-executable (file-exists-p phpactor-executable))
141+
(phpactor-install-or-update)
142+
(phpactor-reset-executable)))
136143

137144
;; Utility functions
138145

0 commit comments

Comments
 (0)