refactor(lib): tidy up doom/version

This commit is contained in:
Henrik Lissner 2022-06-19 01:31:32 +02:00
parent 498d88ba9b
commit 23678c52fe
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -323,25 +323,28 @@ ready to be pasted in a bug report on github."
(defun doom/version () (defun doom/version ()
"Display the running version of Doom core, module sources, and Emacs." "Display the running version of Doom core, module sources, and Emacs."
(interactive) (interactive)
(print! "%-13s v%-15s %s" (print! "%s\n%s\n%s"
"GNU Emacs" (format "%-13s v%-15s %s"
emacs-version "GNU Emacs"
emacs-repository-version) emacs-version
(let ((default-directory doom-emacs-dir)) emacs-repository-version)
(print! "%-13s v%-15s %s" (format "%-13s v%-15s %s"
"Doom core" "Doom core"
doom-version doom-version
(or (cdr (doom-call-process "git" "log" "-1" "--format=%D %h %ci")) (or (cdr (doom-call-process
"n/a"))) "git" "-C" doom-emacs-dir
;; NOTE This is a placeholder. Our modules will be moved to its own repo "log" "-1" "--format=%D %h %ci"))
;; eventually, and Doom core will later be capable of managing them like "n/a"))
;; package sources. ;; NOTE This is a placeholder. Our modules will be moved to its own
(let ((default-directory doom-modules-dir)) ;; repo eventually, and Doom core will later be capable of managing
(print! "%-13s v%-15s %s" ;; them like package sources.
"Doom modules" (format "%-13s v%-15s %s"
doom-modules-version "Doom modules"
(or (cdr (doom-call-process "git" "log" "-1" "--format=%D %h %ci")) doom-modules-version
"n/a")))) (or (cdr (doom-call-process
"git" "-C" doom-modules-dir
"log" "-1" "--format=%D %h %ci"))
"n/a"))))
;;;###autoload ;;;###autoload
(defun doom/info () (defun doom/info ()