Fix doom purge reporting failure despite success

This commit is contained in:
Henrik Lissner 2019-07-26 20:04:08 +02:00
parent a3e262c7ac
commit f8c4d075a5
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -286,12 +286,12 @@ a list of packages that will be updated."
(dolist (it packages) (dolist (it packages)
(print! (info "Deleting %s/%s") label it) (print! (info "Deleting %s/%s") label it)
(dolist (path (list ,@files)) (dolist (path (list ,@files))
(if (file-directory-p path) (cond ((file-directory-p path)
(delete-directory path 'recursive) (delete-directory path 'recursive))
(if (file-exists-p path) ((file-regular-p path)
(delete-file path) (delete-file path)))
(print! (error "Failed to find %s/%s") label it))) (if (file-exists-p path)
(unless (file-exists-p path) (print! (error "Failed to find %s/%s") label it)
(cl-incf n)))) (cl-incf n))))
(if (= n 0) (if (= n 0)
(ignore (print! (warn "Didn't prune any %s(s) for some reason" label))) (ignore (print! (warn "Didn't prune any %s(s) for some reason" label)))