ui/doom-dashboard: don't cd into non-existent directories

Causes CDPATH errors.
This commit is contained in:
Henrik Lissner 2018-01-05 04:31:44 -05:00
parent 764620aa11
commit bee80c1a24
No known key found for this signature in database
GPG Key ID: 5F6C0EA160557395

View File

@ -124,8 +124,9 @@ whose dimensions may not be fully initialized by the time this is run."
(defun +doom-dashboard-update-pwd ()
"TODO"
(with-current-buffer (doom-fallback-buffer)
(cd (or (+doom-dashboard--get-pwd)
default-directory))))
(let ((new-pwd (+doom-dashboard--get-pwd)))
(when (and new-pwd (file-directory-p new-pwd))
(setq default-directory new-pwd)))))
(defun +doom-dashboard-reload (&optional force)
"Update the DOOM scratch buffer (or create it, if it doesn't exist)."