bin/doom: add -l/--local/DOOMLOCALDIR

Will come in handy for the new testing framework.
This commit is contained in:
Henrik Lissner 2019-07-22 02:35:10 +02:00
parent ebdc9d610b
commit a7ce48c2df
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 8 additions and 1 deletions

View file

@ -35,6 +35,7 @@
" -d --debug\t\tTurns on doom-debug-mode (and debug-on-error)\n"
" -e --emacsd DIR\tUse the emacs config at DIR (e.g. ~/.emacs.d)\n"
" -i --insecure\t\tDisable TLS/SSL validation (not recommended)\n"
" -l --local DIR\tUse DIR as your local storage directory\n"
" -p --private DIR\tUse the private module at DIR (e.g. ~/.doom.d)\n"
" -y --yes\t\tAuto-accept all confirmation prompts\n\n")
(princ (buffer-string)))
@ -62,6 +63,10 @@
(or (file-directory-p doom-private-dir)
(message "Warning: %s does not exist"
(abbreviate-file-name doom-private-dir))))
((or "-l" "--local")
(setq doom-local-dir (expand-file-name (concat (pop args) "/")))
(setenv "DOOMLOCALDIR" doom-local-dir)
(message "DOOMLOCALDIR changed to %s" doom-local-dir))
((or "-e" "--emacsd")
(setq emacs-dir (expand-file-name (concat (pop args) "/")))
(message "Emacs directory changed to %s" emacs-dir))

View file

@ -38,7 +38,9 @@ decrease this. If you experience stuttering, increase this.")
(defvar doom-modules-dir (concat doom-emacs-dir "modules/")
"The root directory for Doom's modules. Must end with a slash.")
(defvar doom-local-dir (concat doom-emacs-dir ".local/")
(defvar doom-local-dir
(or (getenv "DOOMLOCALDIR")
(concat doom-emacs-dir ".local/"))
"Root directory for local storage.
Use this as a storage location for this system's installation of Doom Emacs.