lang/lua: improve main.lua detection in +lua/run-love-game
This commit is contained in:
parent
8d72257aa6
commit
46dbf8f490
1 changed files with 6 additions and 5 deletions
|
@ -11,9 +11,10 @@
|
||||||
(defun +lua/run-love-game ()
|
(defun +lua/run-love-game ()
|
||||||
"Run the current project with Love2D."
|
"Run the current project with Love2D."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
(when-let* ((root (locate-dominating-file buffer-file-name "main.lua")))
|
||||||
(async-shell-command
|
(async-shell-command
|
||||||
(format "%s %s"
|
(format "%s %s"
|
||||||
(or (executable-find "love")
|
(or (executable-find "love")
|
||||||
(if IS-MAC "open -a love.app"))
|
(if IS-MAC "open -a love.app"))
|
||||||
(shell-quote-argument (doom-project-root)))))
|
(shell-quote-argument (file-name-directory root))))))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue