Only resolve package :local-repo if relative path exists

This allows you to specify a :local-repo relative to the directory your
packages.el is in. If it doesn't exist, it'll assume you meant a
directory in ~/.emacs.d/.local/straight/repos
This commit is contained in:
Henrik Lissner 2020-04-29 00:29:17 -04:00
parent 2deaafd03a
commit aca1599a81
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -269,9 +269,13 @@ elsewhere."
recipe
;; Expand :local-repo from current directory
(when local-repo
(plist-put! plist :recipe
(plist-put recipe :local-repo
(expand-file-name local-repo ,(dir!)))))))
(plist-put!
plist :recipe
(plist-put recipe :local-repo
(let ((local-path (expand-file-name local-repo ,(dir!))))
(if (file-directory-p local-path)
local-path
local-repo)))))))
(error
(signal 'doom-package-error
(cons ,(symbol-name name)