fix(lib): doom/{reload,upgrade}: ensure env matches session

This commit is contained in:
Henrik Lissner 2024-08-24 17:25:35 -04:00
parent a8ba8feecb
commit 9c6a5e9323
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -57,6 +57,13 @@ And jumps to your `doom!' block."
(declare (indent 2))
`(let ((default-directory doom-emacs-dir)
(exec-path (cons doom-bin-dir exec-path)))
;; Ensure the bin/doom operates with the same environment as this
;; running session.
(letenv! (("EMACS" (doom-path invocation-directory invocation-name))
("EMACSDIR" doom-emacs-dir)
("DOOMDIR" doom-user-dir)
("DOOMLOCALDIR" doom-local-dir)
("DEBUG" (and doom-debug-mode "1")))
(with-current-buffer (compile ,command t)
(let ((w (get-buffer-window (current-buffer))))
(select-window w)
@ -68,7 +75,7 @@ And jumps to your `doom!' block."
(delete-window w)
,on-success)
,on-failure))
nil 'local)))))
nil 'local))))))
(defvar doom-reload-command "doom sync -B -e"
"Command that `doom/reload' runs.")