Reload init before running straight-check-all

This commit is contained in:
David Morgan 2022-10-11 17:17:33 +01:00
parent 1476971132
commit ecc14cd182
Signed by: djm
GPG Key ID: C171251002C200F2
1 changed files with 6 additions and 1 deletions

View File

@ -48,6 +48,10 @@ that everything loaded by `require' or `use-package' is re-loaded."
(setq features (seq-filter '(lambda (elt) (not (string-prefix-p "init-" (prin1-to-string elt)))) features))
(funcall func))
(defun reload-init ()
"Reload `user-init-file', ensuring that requires are reloaded."
(run-straight-lock-file-function #'(lambda () (load (or user-init-file "~/.emacs.d/init.el") nil 'nomessage))))
;; emacs --batch -l "~/.emacs.d/init.el" -f "my/upgrade-packages"
(defun my/upgrade-packages ()
"Upgrade all packages installed with straight."
@ -55,7 +59,8 @@ that everything loaded by `require' or `use-package' is re-loaded."
(straight-pull-recipe-repositories) ;; TODO is this needed?
(straight-x-fetch-all)
(straight-merge-all)
(run-straight-lock-file-function 'straight-check-all)
(reload-init)
(straight-check-all)
;; Do this automatically, as we can always revert and thaw
(run-straight-lock-file-function 'straight-freeze-versions))