lang/lua: improve main.lua detection in +lua/run-love-game

This commit is contained in:
Henrik Lissner
2018-03-18 22:18:34 -04:00
parent 8d72257aa6
commit 46dbf8f490

View File

@ -11,9 +11,10 @@
(defun +lua/run-love-game ()
"Run the current project with Love2D."
(interactive)
(async-shell-command
(format "%s %s"
(or (executable-find "love")
(if IS-MAC "open -a love.app"))
(shell-quote-argument (doom-project-root)))))
(when-let* ((root (locate-dominating-file buffer-file-name "main.lua")))
(async-shell-command
(format "%s %s"
(or (executable-find "love")
(if IS-MAC "open -a love.app"))
(shell-quote-argument (file-name-directory root))))))