feat(cli): add --reload switch to 'profiles sync'

So 'doom profiles sync' can be relied on to forcibly regenerate the
profile init by default.
This commit is contained in:
Henrik Lissner
2022-09-17 13:05:06 +02:00
parent edf54a398b
commit 753b479ea6
2 changed files with 3 additions and 3 deletions

View File

@ -31,14 +31,14 @@
;; ;;
;;; doom profiles ... ;;; doom profiles ...
(defcli! (profiles sync) () (defcli! (profiles sync) ((reload? ("--reload")))
"Synchronize your profiles with Doom." "Synchronize your profiles with Doom."
:benchmark t :benchmark t
(let* ((old-profiles (doom-profiles-read doom-cli-known-profiles-file)) (let* ((old-profiles (doom-profiles-read doom-cli-known-profiles-file))
(new-profiles (doom-profiles-autodetect)) (new-profiles (doom-profiles-autodetect))
(init-file doom-profiles-bootstrap-file) (init-file doom-profiles-bootstrap-file)
(version (doom-file-read init-file :by 'read :noerror t)) (version (doom-file-read init-file :by 'read :noerror t))
(recreate? (doom-profiles-outdated-p))) (recreate? (or (not reload?) (doom-profiles-outdated-p))))
(unless (file-exists-p init-file) (unless (file-exists-p init-file)
(print! (warn "No profile manifest found. Generating one...")) (print! (warn "No profile manifest found. Generating one..."))
(print-group! (print! (start "Regenerating it..."))) (print-group! (print! (start "Regenerating it...")))

View File

@ -45,7 +45,7 @@ OPTIONS:
Defaults to the maximum number of threads (or 1, if your CPU's threadcount Defaults to the maximum number of threads (or 1, if your CPU's threadcount
can't be determined)." can't be determined)."
:benchmark t :benchmark t
(call! '(profiles sync)) (call! '(profiles sync "--reload"))
(run-hooks 'doom-before-sync-hook) (run-hooks 'doom-before-sync-hook)
(add-hook 'kill-emacs-hook #'doom-sync--abort-warning-h) (add-hook 'kill-emacs-hook #'doom-sync--abort-warning-h)
(when jobs (when jobs