let `get-doc` and `get-metas` work with pagetree sources (fixes #159)

pull/160/merge
Matthew Butterick 7 years ago
parent 6c14fde7bc
commit a731428072

@ -85,15 +85,12 @@
(define (convert+validate-path pagenode-or-path caller)
(let ([path (get-source (if (pagenode? pagenode-or-path)
(build-path (current-project-root) (symbol->string pagenode-or-path))
pagenode-or-path))])
(unless path
;; use `pagenode-or-path` in error message because at this point `path` is #f
(raise
(make-exn:fail:filesystem
(format "~a: no source found for '~a' in directory ~a" caller pagenode-or-path (current-directory))
(current-continuation-marks))))
(let* ([path (if (pagenode? pagenode-or-path)
(build-path (current-project-root) (symbol->string pagenode-or-path))
pagenode-or-path)]
[path (or (get-source path) path)])
(unless (file-exists? path)
(raise-argument-error caller "existing Pollen source, or name of its output path" path))
path))

@ -1 +1 @@
1513026723
1513200079

Loading…
Cancel
Save