fix(cli): upgrade: don't 'doom sync' if aborted

There are some cases where the upgrade process will abort (due to
failure or user input), and it then runs `doom sync` anyway. Don't do
that.

Fix: #8595
This commit is contained in:
Henrik Lissner 2025-12-13 17:04:31 -05:00
parent b6eef6941b
commit e69d417c5f
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -32,11 +32,7 @@ libraries. It is the equivalent of the following shell commands:
$ cd ~/.emacs.d
$ git pull --rebase
$ doom sync -u"
(let* ((force? (doom-cli-context-suppress-prompts-p context))
(sync-cmd (append '("sync" "-u")
(if aot? '("--aot"))
(if nobuild? '("-B"))
(if jobs `("-j" ,jobs)))))
(let ((force? (doom-cli-context-suppress-prompts-p context)))
(cond
(packages?
;; HACK It's messy to use straight to upgrade straight, due to the
@ -50,7 +46,10 @@ libraries. It is the equivalent of the following shell commands:
(print! (item "Preparing straight for an update"))
(delete-directory (doom-path straight-base-dir "straight/repos/straight.el")
'recursive)))
(call! sync-cmd)
(call! (append '("sync" "-u")
(if aot? '("--aot"))
(if nobuild? '("-B"))
(if jobs `("-j" ,jobs))))
(print! (success "Finished upgrading Doom Emacs")))
((doom-cli-upgrade context force? force?)
@ -62,10 +61,7 @@ libraries. It is the equivalent of the following shell commands:
(if aot? "--aot")
(if nobuild? "-B")
(if force? "--force")
(if jobs (format "--jobs=%d" jobs))))
((print! "Doom is up-to-date!")
(call! sync-cmd)))))
(if jobs (format "--jobs=%d" jobs)))))))
;;