mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
refactor(cli): set __DOOMCONTEXT at runtime
Addresses the edge case where the user sets (or unsets) __DOOMCONTEXT in their CLI config.
This commit is contained in:
@ -1144,7 +1144,6 @@ Emacs' batch library lacks an implementation of the exec system call."
|
|||||||
(convert-buffer doom-cli-context-stderr))
|
(convert-buffer doom-cli-context-stderr))
|
||||||
(prin1 newcontext (current-buffer))))
|
(prin1 newcontext (current-buffer))))
|
||||||
(set-file-modes context-file #o400)
|
(set-file-modes context-file #o400)
|
||||||
(setenv "__DOOMCONTEXT" context-file)
|
|
||||||
(make-directory (file-name-directory script-file) t)
|
(make-directory (file-name-directory script-file) t)
|
||||||
(let ((coding-system-for-write 'utf-8-auto)
|
(let ((coding-system-for-write 'utf-8-auto)
|
||||||
(persistent-files (combine-and-quote-strings (delq nil (list script-file context-file))))
|
(persistent-files (combine-and-quote-strings (delq nil (list script-file context-file))))
|
||||||
@ -1163,6 +1162,7 @@ Emacs' batch library lacks an implementation of the exec system call."
|
|||||||
"_doomcleanup() {\n rm -f " persistent-files "\n}\n"
|
"_doomcleanup() {\n rm -f " persistent-files "\n}\n"
|
||||||
"_doomrun() {\n " command "\n}\n"
|
"_doomrun() {\n " command "\n}\n"
|
||||||
(string-join env " \\\n")
|
(string-join env " \\\n")
|
||||||
|
"__DOOMCONTEXT=" (shell-quote-argument context-file) " \\\n"
|
||||||
(format "PATH=\"%s%s$PATH\" \\\n"
|
(format "PATH=\"%s%s$PATH\" \\\n"
|
||||||
(doom-path doom-emacs-dir "bin")
|
(doom-path doom-emacs-dir "bin")
|
||||||
path-separator)
|
path-separator)
|
||||||
|
Reference in New Issue
Block a user