Add EMACSDIR envvar support to bin/doom
As an alternative to the -e/--emacsd options. Sometimes it is more consistent to customize bin/doom this way. e.g. EMACS=/another/bin/emacs DOOMDIR=~/someplace EMACSDIR=~/emacsd bin/doom install
This commit is contained in:
parent
151858a8dc
commit
9f9b7ad792
1 changed files with 5 additions and 3 deletions
8
bin/doom
8
bin/doom
|
@ -40,7 +40,8 @@
|
||||||
|
|
||||||
;;
|
;;
|
||||||
(let ((args (cdr (cdr (cdr command-line-args))))
|
(let ((args (cdr (cdr (cdr command-line-args))))
|
||||||
(emacs-dir (expand-file-name "../" (file-name-directory load-file-name))))
|
(emacs-dir (or (getenv "EMACSDIR")
|
||||||
|
(expand-file-name "../" (file-name-directory load-file-name)))))
|
||||||
;; Parse options
|
;; Parse options
|
||||||
(while (ignore-errors (string-prefix-p "-" (car args)))
|
(while (ignore-errors (string-prefix-p "-" (car args)))
|
||||||
(pcase (pop args)
|
(pcase (pop args)
|
||||||
|
@ -61,14 +62,15 @@
|
||||||
(message "DOOMDIR changed to %s" doom-private-dir))
|
(message "DOOMDIR changed to %s" doom-private-dir))
|
||||||
((or "-e" "--emacsd")
|
((or "-e" "--emacsd")
|
||||||
(setq emacs-dir (expand-file-name (concat (pop args) "/")))
|
(setq emacs-dir (expand-file-name (concat (pop args) "/")))
|
||||||
(or (file-directory-p emacs-dir)
|
|
||||||
(error "%s does not exist" emacs-dir))
|
|
||||||
(message "Emacs directory changed to %s" emacs-dir))
|
(message "Emacs directory changed to %s" emacs-dir))
|
||||||
((or "-y" "--yes")
|
((or "-y" "--yes")
|
||||||
(setq doom-auto-accept t)
|
(setq doom-auto-accept t)
|
||||||
(setenv "YES" "1")
|
(setenv "YES" "1")
|
||||||
(message "Auto-yes mode on"))))
|
(message "Auto-yes mode on"))))
|
||||||
|
|
||||||
|
(or (file-directory-p emacs-dir)
|
||||||
|
(error "%s does not exist" emacs-dir))
|
||||||
|
|
||||||
;; Bootstrap Doom
|
;; Bootstrap Doom
|
||||||
(load (expand-file-name "init" emacs-dir)
|
(load (expand-file-name "init" emacs-dir)
|
||||||
nil 'nomessage)
|
nil 'nomessage)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue