(fix)core: make 'fd and 'fdfind backend work for listing files (#2021)

This commit is contained in:
Nicolas Chachereau
2022-01-12 00:05:27 +01:00
committed by GitHub
parent b67bccd6c2
commit 86c9085363

View File

@ -279,8 +279,8 @@ E.g. (\".org\") => (\"*.org\" \"*.org.gpg\")"
(defun org-roam--list-files-fd (executable dir)
"Return all Org-roam files under DIR, using \"fd\", provided as EXECUTABLE."
(let* ((globs (org-roam--list-files-search-globs org-roam-file-extensions))
(extensions (string-join (mapcar (lambda (glob) (substring glob 2 -1)) globs) " -e "))
(command (string-join `(,executable "-L" ,dir "--type file" ,extensions) " ")))
(extensions (string-join (mapcar (lambda (glob) (concat "-e " (substring glob 2 -1))) globs) " "))
(command (string-join `(,executable "-L" "--type file" ,extensions "." ,dir) " ")))
(org-roam--shell-command-files command)))
(defalias 'org-roam--list-files-fdfind #'org-roam--list-files-fd)