diff options
author | Colin Okay <okay@toyful.space> | 2021-08-19 07:48:38 -0500 |
---|---|---|
committer | Colin Okay <okay@toyful.space> | 2021-08-19 07:48:38 -0500 |
commit | a8563036165449a4663b6e49624ab6b220f775e0 (patch) | |
tree | 09b0290c494bbdb640accfa7214b06390706c73b | |
parent | 3bf196ab99031366b0fe36c5d75386b59d739424 (diff) |
changed the way add-files-matching works
-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))) |