feat(cli): doom upgrade: add -B option

To mirror doom sync's -B option.
This commit is contained in:
Henrik Lissner 2024-03-27 00:23:41 -04:00
parent d5bad5b430
commit aef2b12100
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -21,6 +21,7 @@
(defcli! ((upgrade up))
((packages? ("-p" "--packages") "Only upgrade packages, not Doom")
(jobs ("-j" "--jobs" num) "How many CPUs to use for native compilation")
(nobuild? ("-B") "Don't rebuild packages when hostname or Emacs version has changed")
&context context)
"Updates Doom and packages.
@ -32,7 +33,9 @@ following shell commands:
doom clean
doom sync -u"
(let* ((force? (doom-cli-context-suppress-prompts-p context))
(sync-cmd (append '("sync" "-u") (if jobs `("-j" ,num)))))
(sync-cmd (append '("sync" "-u")
(if nobuild? '("-B"))
(if jobs `("-j" ,num)))))
(cond
(packages?
;; HACK It's messy to use straight to upgrade straight, due to the
@ -55,6 +58,7 @@ following shell commands:
(print! (item "Reloading Doom Emacs"))
(doom-cli-context-put context 'upgrading t)
(exit! "doom" "upgrade" "-p"
(if nobuild? "-B")
(if force? "--force")
(if jobs (format "--jobs=%d" jobs))))