From a7ce48c2df84373e0f320e930116b06c7352f3b6 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 22 Jul 2019 02:35:10 +0200 Subject: [PATCH] bin/doom: add -l/--local/DOOMLOCALDIR Will come in handy for the new testing framework. --- bin/doom | 5 +++++ core/core.el | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/bin/doom b/bin/doom index 600bf7b74..75842a312 100755 --- a/bin/doom +++ b/bin/doom @@ -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)) diff --git a/core/core.el b/core/core.el index 6fc391a87..aa03e9381 100644 --- a/core/core.el +++ b/core/core.el @@ -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.