fix(cli): 'Profiles not initialized' error

Due to $DOOMPROFILE being set to an empty string when persisting Doom
CLI sessions, which would affect any case where a CLI command restarts
the session (e.g. when the :config literate module tangles a config or
'doom --debug ...' restarts to set DEBUG=1).
This commit is contained in:
Henrik Lissner 2022-09-19 00:01:03 +02:00
parent e20af47f22
commit b65da762b8
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -1206,7 +1206,7 @@ Emacs' batch library lacks an implementation of the exec system call."
"_doomrun() {\n " ,command "\n}\n" "_doomrun() {\n " ,command "\n}\n"
,(string-join persisted-env " \\\n") ,(string-join persisted-env " \\\n")
,(cl-loop for (envvar . val) ,(cl-loop for (envvar . val)
in `(("DOOMPROFILE" . ,(doom-profile->id (or doom-profile doom-profile-default))) in `(("DOOMPROFILE" . ,(ignore-errors (doom-profile->id doom-profile)))
("EMACSDIR" . ,doom-emacs-dir) ("EMACSDIR" . ,doom-emacs-dir)
("DOOMDIR" . ,doom-user-dir) ("DOOMDIR" . ,doom-user-dir)
("DEBUG" . ,(if init-file-debug "1")) ("DEBUG" . ,(if init-file-debug "1"))