From 7fec2cf5bb9f9b2661f05560c6179a51d3848151 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 17 Sep 2022 15:29:22 +0200 Subject: [PATCH] tweak(profiles): regen profiles if generator version changed The profile bootstrap file's first form is the doom-version it was generated with. If this has changed, it should be considered outdated, even if the user's profiles haven't changed. --- lisp/doom-profiles.el | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lisp/doom-profiles.el b/lisp/doom-profiles.el index 1f6e46303..2ec4f11a6 100644 --- a/lisp/doom-profiles.el +++ b/lisp/doom-profiles.el @@ -123,9 +123,13 @@ is non-nil, refresh the cache." doom-profile-dirs)) (defun doom-profiles-outdated-p () - "Return non-nil if files in `doom-profiles-bootstrap-file' are outdated." - (cl-find-if (doom-rpartial #'file-newer-than-file-p doom-profiles-bootstrap-file) - doom-profile-config-files)) + "Return non-nil if files in `doom-profile-loader-file' are outdated." + (cl-loop for file in doom-profile-config-files + if (or (not (file-exists-p doom-profiles-bootstrap-file)) + (file-newer-than-file-p file doom-profiles-bootstrap-file) + (not (equal (doom-file-read doom-profiles-bootstrap-file :by 'read) + doom-version))) + return t)) (defun doom-profile<-id (id) "Return a (NAME . VERSION) profile cons cell from an id string NAME@VERSION."