refactor(cli): s/doom-cli-sync-info-file/doom-sync-info-file

To conform to new naming conventions.
This commit is contained in:
Henrik Lissner
2025-01-09 14:28:54 -05:00
parent 2b4f762b1e
commit 295cee7c78

View File

@ -14,7 +14,8 @@
(defvar doom-before-sync-hook () (defvar doom-before-sync-hook ()
"Hooks run before 'doom sync' synchronizes the user's config with Doom.") "Hooks run before 'doom sync' synchronizes the user's config with Doom.")
(defvar doom-cli-sync-info-file (file-name-concat doom-profile-data-dir "sync")) ;; DEPRECATED: Will be removed once `doom-profile' is a struct
(defvar doom-sync-info-file (file-name-concat doom-profile-data-dir "sync"))
;; ;;
@ -74,7 +75,7 @@ OPTIONS:
;; necessarily back/forward compatible across major versions, and many ;; necessarily back/forward compatible across major versions, and many
;; packages bake in hardcoded data at compile-time. ;; packages bake in hardcoded data at compile-time.
(pcase-let ((`(,old-version . ,hash) (pcase-let ((`(,old-version . ,hash)
(doom-file-read doom-cli-sync-info-file :by 'read :noerror t)) (doom-file-read doom-sync-info-file :by 'read :noerror t))
(to-rebuild nil)) (to-rebuild nil))
(when (and old-version (not (equal old-version emacs-version))) (when (and old-version (not (equal old-version emacs-version)))
(print! (warn "Emacs version has changed since last sync (from %s to %s)") old-version emacs-version) (print! (warn "Emacs version has changed since last sync (from %s to %s)") old-version emacs-version)
@ -101,8 +102,8 @@ OPTIONS:
(when (doom-profile-generate) (when (doom-profile-generate)
(print! (item "Restart Emacs for changes to take effect")) (print! (item "Restart Emacs for changes to take effect"))
(run-hooks 'doom-after-sync-hook)) (run-hooks 'doom-after-sync-hook))
(when (or rebuild? (not (file-exists-p doom-cli-sync-info-file))) (when (or rebuild? (not (file-exists-p doom-sync-info-file)))
(with-temp-file doom-cli-sync-info-file (with-temp-file doom-sync-info-file
(prin1 (cons emacs-version (doom-sync--system-hash)) (prin1 (cons emacs-version (doom-sync--system-hash))
(current-buffer)))) (current-buffer))))
t) t)