fix(cli): ignored --{profile,doomdir,emacsdir,debug}
Fixes an edge case where --profile, --doomdir, --emacsdir, and --debug were ignored if used in a nested bin/doom call. Now possible thanks to49d3f1e
. Ref:49d3f1e96c
This commit is contained in:
parent
49d3f1e96c
commit
314463bd49
1 changed files with 20 additions and 17 deletions
37
bin/doom
37
bin/doom
|
@ -202,28 +202,31 @@ SEE ALSO:
|
||||||
instead."
|
instead."
|
||||||
(when color?
|
(when color?
|
||||||
(setq doom-print-backend (if (eq color? :yes) 'ansi)))
|
(setq doom-print-backend (if (eq color? :yes) 'ansi)))
|
||||||
;; For these settings to take full effect, the script must be restarted:
|
|
||||||
(when (and (equal (doom-cli-context-step context) 0)
|
|
||||||
(or profile
|
|
||||||
debug?
|
|
||||||
emacsdir
|
|
||||||
doomdir))
|
|
||||||
(when profile
|
|
||||||
(setenv "DOOMPROFILE" profile))
|
|
||||||
(when debug?
|
|
||||||
(setenv "DEBUG" "1")
|
|
||||||
(print! (item "Debug mode enabled")))
|
|
||||||
(when emacsdir
|
|
||||||
(setenv "EMACSDIR" emacsdir))
|
|
||||||
(when doomdir
|
|
||||||
(setenv "DOOMDIR" doomdir))
|
|
||||||
(exit! :restart))
|
|
||||||
;; But these don't need a restart:
|
|
||||||
(when pager
|
(when pager
|
||||||
(setq doom-cli-pager pager))
|
(setq doom-cli-pager pager))
|
||||||
(when force?
|
(when force?
|
||||||
(setf (doom-cli-context-suppress-prompts-p context) t)
|
(setf (doom-cli-context-suppress-prompts-p context) t)
|
||||||
(doom-log "User requested all prompts be suppressed"))
|
(doom-log "User requested all prompts be suppressed"))
|
||||||
|
;; For these settings to take full effect, the script must be restarted:
|
||||||
|
(when (or debug?
|
||||||
|
profile
|
||||||
|
emacsdir
|
||||||
|
doomdir)
|
||||||
|
(let (omit)
|
||||||
|
(when debug?
|
||||||
|
(setenv "DEBUG" "1")
|
||||||
|
(print! (item "Debug mode enabled"))
|
||||||
|
(push "--debug" omit))
|
||||||
|
(when profile
|
||||||
|
(setenv "DOOMPROFILE" profile)
|
||||||
|
(push "--profile=" omit))
|
||||||
|
(when emacsdir
|
||||||
|
(setenv "EMACSDIR" emacsdir)
|
||||||
|
(push "--emacsdir=" omit))
|
||||||
|
(when doomdir
|
||||||
|
(setenv "DOOMDIR" doomdir)
|
||||||
|
(push "--doomdir=" omit))
|
||||||
|
(exit! :restart :omit omit)))
|
||||||
;; Load extra files and forms, as per given options.
|
;; Load extra files and forms, as per given options.
|
||||||
(dolist (file loads)
|
(dolist (file loads)
|
||||||
(load (doom-path (cdr file))
|
(load (doom-path (cdr file))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue