From 201051c368cfdabf3f68c372939297380999e28d Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 27 Mar 2024 00:23:54 -0400 Subject: [PATCH] fix(cli): doom sync: suppress rebuild prompt when upgrading 12a765c introduced suppression of package-rebuilding prompts on 'doom upgrade', but inadvertently reversed the check. This fixes that (and refactors the if/or tree into a `cond`). Amend: 12a765c5099c --- lisp/cli/sync.el | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lisp/cli/sync.el b/lisp/cli/sync.el index 54fbf0117..6b7274e0e 100644 --- a/lisp/cli/sync.el +++ b/lisp/cli/sync.el @@ -74,13 +74,14 @@ OPTIONS: (print! (warn "Your system has changed since last sync")) (setq to-rebuild t)) (when (and to-rebuild (not (doom-cli-context-suppress-prompts-p context))) - (if nobuild? - (print! (warn "Packages need to be recompiled, but -B has prevented it. Skipping...")) - (or (not (doom-cli-context-get context 'upgrading)) - (y-or-n-p - (format! " %s" "Your installed packages will need to be recompiled. Do so now?")) - (exit! 0)) - (setq rebuild? t)))) + (cond (nobuild? + (print! (warn "Packages must be rebuilt, but -B has prevented it. Skipping..."))) + ((doom-cli-context-get context 'upgrading) + (print! (warn "Packages will be rebuilt")) + (setq rebuild? t)) + ((y-or-n-p (format! " %s" "Installed packages must be rebuilt. Do so now?")) + (setq rebuild? t)) + ((exit! 0))))) (when (and (not noenvvar?) (file-exists-p doom-env-file)) (call! '(env)))