Improve error-handling in doom/update-package

This commit is contained in:
Henrik Lissner 2019-01-21 03:48:10 -05:00
parent 99e916348a
commit efa577dec2
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -427,12 +427,15 @@ calls."
(declare (interactive-only t))
(interactive
(let* ((packages (doom-get-outdated-packages))
(package (if packages
(completing-read "Update package: "
(mapcar #'car packages)
nil t)
(user-error "All packages are up to date"))))
(list (cdr (assq (car (assoc package package-alist)) packages)))))
(selection (if packages
(completing-read "Update package: "
(mapcar #'car packages)
nil t)
(user-error "All packages are up to date")))
(name (car (assoc selection package-alist))))
(unless name
(user-error "'%s' is already up-to-date" selection))
(list (cdr (assq name packages)))))
(doom-initialize-packages)
(cl-destructuring-bind (package old-version new-version) pkg
(if-let* ((desc (doom-package-outdated-p package)))