mirror of
https://github.com/roswell/roswell.git
synced 2026-09-10 07:16:17 -04:00
change search algorithm for templates
This commit is contained in:
parent
75dbb06188
commit
598cb5a7f5
|
|
@ -16,8 +16,17 @@ exec ros -Q -m roswell -L sbcl-bin -- $0 "$@"
|
|||
(declare (ignore cmd))
|
||||
(if (and (equal subcmd "main") name)
|
||||
(let* ((date (get-universal-time))
|
||||
(path (format nil "templates/~A/~A.asd" name name)))
|
||||
(setq path (probe-file (merge-pathnames path (ros.util:homedir))))
|
||||
path)
|
||||
(setq path
|
||||
(or (probe-file (merge-pathnames (format nil "templates/~A/template.asd" name) (ros.util:homedir)))
|
||||
(unless (find #\/ name)
|
||||
(let ((dir (directory (merge-pathnames (format nil "templates/*/~A/template.asd" name) (ros.util:homedir)))))
|
||||
(unless (= (length dir) 1)
|
||||
(format *error-output* "ambiguous ~{~A~%~}" dir)
|
||||
(quit -1))
|
||||
(setq name (format nil "~{~A~^/~}" (last (pathname-directory (first dir)) 2)))
|
||||
;; [fix me] '2' is not apropriate.
|
||||
(first dir)))))
|
||||
(when path
|
||||
(load path)
|
||||
(ql:quickload name :silent t)
|
||||
|
|
|
|||
Loading…
Reference in a new issue