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
No known key found for this signature in database
GPG key ID: B60957CA074D39A3
2 changed files with 3 additions and 3 deletions

View file

@ -31,14 +31,14 @@
;;
;;; doom profiles ...
(defcli! (profiles sync) ()
(defcli! (profiles sync) ((reload? ("--reload")))
"Synchronize your profiles with Doom."
:benchmark t
(let* ((old-profiles (doom-profiles-read doom-cli-known-profiles-file))
(new-profiles (doom-profiles-autodetect))
(init-file doom-profiles-bootstrap-file)
(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)
(print! (warn "No profile manifest found. Generating one..."))
(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
can't be determined)."
:benchmark t
(call! '(profiles sync))
(call! '(profiles sync "--reload"))
(run-hooks 'doom-before-sync-hook)
(add-hook 'kill-emacs-hook #'doom-sync--abort-warning-h)
(when jobs