                      (straight--byte-compile-package recipe)))))))))
      (if (= n 0)
          (ignore (print! (success "No packages need rebuilding")))
-       (doom--finalize-straight)
        (print! (success "Rebuilt %d package(s)" n))
        t))))
 

         (print! (start "Regrafting %d repos..." (length repos-to-regraft)))
         (and (doom--cli-packages-regraft-repos repos-to-regraft)
              (setq success t)))
       (when success
         (doom--finalize-straight)
         t)))))

       (let ((count (hash-table-count straight--packages-to-rebuild))
             (packages (hash-table-keys straight--packages-to-rebuild)))
         (sort packages #'string-lessp)
         (print! (success "Updated %d package(s): %s")
                 count (string-join packages ", "))
         (doom-cli-packages-build))
