From 204783a96e1b56b9455539fedb2ecbf0947cdd91 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 19 May 2020 20:14:13 -0400 Subject: [PATCH] Change how doom core reloads itself after 'doom upgrade' Hopefully to address weird void-function errors while upgrading. --- core/cli/upgrade.el | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/core/cli/upgrade.el b/core/cli/upgrade.el index 0d90e5fc1..5fa4aa17c 100644 --- a/core/cli/upgrade.el +++ b/core/cli/upgrade.el @@ -106,25 +106,21 @@ following shell commands: (print! (start "Upgrading Doom Emacs...")) (print-group! (doom-clean-byte-compiled-files) - (if (and (zerop (car (doom-call-process "git" "reset" "--hard" target-remote))) - (equal (vc-git--rev-parse "HEAD") new-rev)) - (print! (info "%s") (cdr result)) + (unless (and (zerop (car (doom-call-process "git" "reset" "--hard" target-remote))) + (equal (vc-git--rev-parse "HEAD") new-rev)) (error "Failed to check out %s" (substring new-rev 0 10))) + (print! (info "%s") (cdr result)) ;; Reload Doom's CLI & libraries, in case there were any ;; upstream changes. Major changes will still break, however (condition-case-unless-debug e (progn - (mapc (doom-rpartial #'unload-feature t) + (mapc (lambda (f) (load (symbol-name f))) '(core core-lib core-cli core-modules core-packages)) - (require 'core) - (require 'core-cli) - (setq doom-init-p nil - doom-init-modules-p nil) - (doom-initialize)) + (doom-initialize 'force)) (error (signal 'doom-error (list "Could not upgrade Doom without issues" e))))