diff options
Diffstat (limited to 'flexo.lisp')
-rw-r--r-- | flexo.lisp | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -395,12 +395,19 @@ artifact tables have changed." :filepath path :keywords keywords)) +(defun sane-file-name (path) + "Returns the string representation of the filename in the pathname + PATH. A sane representation includes the file extension, if present." + (if (pathname-type path) + (format nil "~a.~a" (pathname-name path) (pathname-type path)) + (pathname-name path))) + (defun add-files-matching (directory-path regex class &rest keywords) "Given a root directory and a regular expression REGEX, call ADD-FILE with the supplied CLASS and KEYWORDS for each file - pathname whose namestring is matched by the REGEX." + filename (including extension) whose namestring is matched by the REGEX." (dolist (path (uiop:directory-files directory-path)) - (when (ppcre:scan regex (namestring path)) + (when (ppcre:scan regex (sane-file-name path)) (apply #'add-file path class keywords))) (dolist (subdir (uiop:subdirectories directory-path)) (apply #'add-files-matching subdir regex class keywords))) |