Skip to content

Commit 4a2ffb6

Browse files
committed
Bail out of `inf-elixir-project' if project root not found
1 parent 404f885 commit 4a2ffb6

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

Diff for: inf-elixir.el

+8-7
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
;; Author: Jonathan Arnett <[email protected]>
66
;; URL: https://github.com/J3RN/inf-elixir
77
;; Keywords: languages, processes, tools
8-
;; Version: 2.0.0
8+
;; Version: 2.1.1
99
;; Package-Requires: ((emacs "25.1"))
1010

1111
;; This file is NOT part of GNU Emacs.
@@ -214,12 +214,13 @@ When called interactively with a prefix argument, the user will
214214
be prompted for the REPL command. The default is provided by
215215
`inf-elixir-project-command'."
216216
(interactive)
217-
(let ((default-directory (inf-elixir--find-project-root))
218-
(cmd (cond
219-
(cmd cmd)
220-
(current-prefix-arg (read-from-minibuffer "Project command: " inf-elixir-project-command nil nil 'inf-elixir-project))
221-
(t inf-elixir-project-command))))
222-
(inf-elixir-run-cmd default-directory cmd)))
217+
(if-let ((default-directory (inf-elixir--find-project-root)))
218+
(let ((cmd (cond
219+
(cmd cmd)
220+
(current-prefix-arg (read-from-minibuffer "Project command: " inf-elixir-project-command nil nil 'inf-elixir-project))
221+
(t inf-elixir-project-command))))
222+
(inf-elixir-run-cmd default-directory cmd))
223+
(message "Could not find project root!")))
223224

224225
(defun inf-elixir-send-line ()
225226
"Send the region to the REPL buffer and run it."

0 commit comments

Comments
 (0)