change project-require to directory-require (pt 3)

pull/27/head
Matthew Butterick 10 years ago
parent df9036e369
commit b92a20378b

@ -80,9 +80,9 @@
(file-proc source-or-output-path)) (file-proc source-or-output-path))
(define (project-requires-changed? source-path) (define (directory-requires-changed? source-path)
(define project-require-files (get-project-require-files source-path)) (define directory-require-files (get-directory-require-files source-path))
(define rerequire-results (and project-require-files (map file-needed-rerequire? project-require-files))) (define rerequire-results (and directory-require-files (map file-needed-rerequire? directory-require-files)))
(define requires-changed? (and rerequire-results (ormap (λ(x) x) rerequire-results))) (define requires-changed? (and rerequire-results (ormap (λ(x) x) rerequire-results)))
(when requires-changed? (when requires-changed?
(begin (begin
@ -97,7 +97,7 @@
(or (not (file-exists? output-path)) (or (not (file-exists? output-path))
(modification-date-expired? source-path template-path) (modification-date-expired? source-path template-path)
(and (not (null-source? source-path)) (file-needed-rerequire? source-path)) (and (not (null-source? source-path)) (file-needed-rerequire? source-path))
(and (world:check-project-requires-in-render?) (project-requires-changed? source-path)))) (and (world:check-directory-requires-in-render?) (directory-requires-changed? source-path))))
(define/contract+provide (render-to-file-if-needed source-path [template-path #f] [maybe-output-path #f] #:force [force #f]) (define/contract+provide (render-to-file-if-needed source-path [template-path #f] [maybe-output-path #f] #:force [force #f])
@ -163,7 +163,7 @@
`(begin `(begin
(require (for-syntax racket/base)) (require (for-syntax racket/base))
(require web-server/templates pollen/cache pollen/debug) (require web-server/templates pollen/cache pollen/debug)
,(require-project-require-files source-path) ,(require-directory-require-files source-path)
(let ([doc (cached-require ,(path->string source-path) ',world:main-pollen-export)] (let ([doc (cached-require ,(path->string source-path) ',world:main-pollen-export)]
[metas (cached-require ,(path->string source-path) ',world:meta-pollen-export)]) [metas (cached-require ,(path->string source-path) ',world:meta-pollen-export)])
(local-require pollen/pagetree pollen/template pollen/top) (local-require pollen/pagetree pollen/template pollen/top)

Loading…
Cancel
Save