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

(defun doom-cli-packages-update ()
  "Updates packages."
  (print! (start "Updating packages (this may take a while)..."))
  ;; TODO Refactor me
  (let ((straight--repos-dir (straight--repos-dir))
        (straight--packages-to-rebuild (make-hash-table :test #'equal))
        (total (hash-table-count straight--repo-cache))
        (i 1)
        errors)
    (print-group!
     (dolist (recipe (hash-table-values straight--repo-cache))
       (straight--with-plist recipe (package type local-repo)
         (condition-case-unless-debug e
             (let ((default-directory (straight--repos-dir local-repo)))
               (if (not (file-in-directory-p default-directory straight--repos-dir))
                   (print! (warn "[%d/%d] Skipping %s because it is local")
                           i total package)
                 (let ((commit (straight-vc-get-commit type local-repo)))
                   (if (not (straight-vc-fetch-from-remote recipe))
                       (print! (warn "\033[K(%d/%d) Failed to fetch %s" i total package))
                     (let ((output (straight--process-get-output)))
                       (straight-merge-package package)
                       (let ((newcommit (straight-vc-get-commit type local-repo)))
                         (if (string= commit newcommit)
                             (print! (start "\033[K(%d/%d) %s is up-to-date\033[1A") i total package)
                           (ignore-errors
                             (delete-directory (straight--build-dir package) 'recursive))
                           (puthash package t straight--packages-to-rebuild)
                           (print! (info "\033[K(%d/%d) Updating %s...") i total package)
                           (unless (string-empty-p output)
                             (print-group!
                              (print! (info "%s") output)
                              (when (eq type 'git)
                                (straight--call "git" "log" "--oneline" newcommit (concat "^" commit))
                                (print-group!
                                 (print! "%s" (straight--process-get-output))))))
                           (print! (success "(%d/%d) %s updated (%s -> %s)") i total package
                                   (substring commit 0 7)
                                   (substring newcommit 0 7))))))))
               (cl-incf i))
           (user-error
            (signal 'user-error (error-message-string e)))
           (error
            (print! (warn "(%d/%d) Encountered error with %s" i total package))
            (print-group!
             (print! (error "%s" e))
             (print-group! (print! (info "%s" (straight--process-get-output)))))
            (push package errors)))))
     (princ "\033[K")
     (when errors
       (print! (error "There were %d errors, the offending packages are: %s")
               (length errors) (string-join errors ", ")))
     (if (hash-table-empty-p straight--packages-to-rebuild)
         (ignore

;;
;;; Library

;; TODO Refactor all of me to be more functional!

(defun doom-cli-packages-install ()
  "Installs missing packages.

