Hi everyone,
Here is some Elisp that I use to make playdate dev a smidge easier. If there are any other emacs wonks, I'd consider turning it into en elisp package for distribution through melpa.
(use-package lua-mode)
(use-package luarocks)
(setenv "PLAYDATE_SDK_PATH" (expand-file-name "~/Developer/PlaydateSDK"))
(defun playdate/sdk-bin (binary)
(shell-quote-argument (expand-file-name (concat (getenv "PLAYDATE_SDK_PATH")
"/bin/"
binary))))
(defun playdate/compile ()
(interactive "")
(when (not (file-directory-p (playdate/pdx-dir)))
(make-directory (playdate/pdx-dir)))
(projectile-run-shell-command-in-root
(concat "pdc source "
(shell-quote-argument(playdate/pdx-dir)))))
(defun playdate/pdx-dir()
(interactive)
(expand-file-name (concat (playdate/game-name) ".pdx")
(projectile-project-root)))
(defun playdate/run-emu ()
(interactive)
(shell-command
(concat "/usr/bin/open "
"-a "
(playdate/sdk-bin "Playdate Simulator.app")
" "
(shell-quote-argument (playdate/pdx-dir)))))
(use-package ini
:straight t)
(defun playdate/read-pdxinfo ()
(cdr (assoc "pdxinfo"
(ini-decode (expand-file-name "source/pdxinfo" (projectile-project-root))))))
(defun playdate/game-name ()
(cdr (assoc "name" (playdate/read-pdxinfo))))