Add --force/-f support to doom refresh

This commit is contained in:
Henrik Lissner 2019-07-22 22:36:48 +02:00
parent 6200f5d876
commit 388267d256
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -145,7 +145,7 @@ BODY will be run when this dispatcher is called."
;;; Dispatch commands
;; Load all of our subcommands
(def-command! (refresh re) (&optional force-p)
(def-command! (refresh re) (&rest args)
"Ensure Doom is properly set up.
This is the equivalent of running autoremove, install, autoloads, then
@ -160,7 +160,9 @@ It will ensure that unneeded packages are removed, all needed packages are
installed, autoloads files are up-to-date and no byte-compiled files have gone
stale."
(print! (green "Initiating a refresh of Doom Emacs...\n"))
(let (success)
(let ((force-p (or (member "-f" args)
(member "--force" args)))
success)
(when (file-exists-p doom-env-file)
(doom-reload-env-file 'force))
(doom-reload-core-autoloads force-p)