diff --git a/quickproject.lisp b/quickproject.lisp index 959d51a..c7a45c7 100644 --- a/quickproject.lisp +++ b/quickproject.lisp @@ -22,6 +22,9 @@ (defvar *include-copyright* nil ; This gives default behavior. "Include a copyright notice at the top of files.") +(defvar *file-renamer* nil + "Function to rename files.") + (defun pathname-project-name (pathname) "Return a project name based on PATHNAME by taking the last element in the pathname-directory list. E.g. returns \"awesome-project\" for @@ -72,7 +75,7 @@ marker is the string \"\(#|\" and the template end marker is the string (flet ((rewrite-template (pathname) (let* ((relative-namestring (enough-namestring pathname template-directory)) - (target-pathname (template-pathname->output-name + (target-pathname (funcall *file-renamer* (merge-pathnames relative-namestring target-directory))) (if-exists if-exists)) @@ -130,7 +133,8 @@ marker is the string \"\(#|\" and the template end marker is the string ((:author *author*) *author*) ((:license *license*) *license*) (name (pathname-project-name pathname) name-provided-p) - ((:include-copyright *include-copyright*) *include-copyright*)) + ((:include-copyright *include-copyright*) *include-copyright*) + (file-renamer #'template-pathname->output-name file-renamer-p)) "Create a project skeleton for NAME in PATHNAME. If DEPENDS-ON is provided, it is used as the asdf defsystem depends-on list." (check-type *depends-on* list) @@ -142,7 +146,8 @@ it is used as the asdf defsystem depends-on list." (setf name (pathname-project-name pathname)))) (ensure-directories-exist pathname) (let ((*default-pathname-defaults* (truename pathname)) - (*name* name)) + (*name* name) + (*file-renamer* file-renamer)) (let (c) (restart-case (handler-case (rewrite-templates *template-directory*