add `unpublished-path?` as settable value

pull/84/head
Matthew Butterick 9 years ago
parent 47a89bb520
commit 03627c10fa

@ -131,7 +131,8 @@ version print the version (~a)" (world:current-server-port) (worl
(when (directory-exists? target-dir) (when (directory-exists? target-dir)
(delete-directory/files target-dir)) (delete-directory/files target-dir))
(copy-directory/files source-dir target-dir) (copy-directory/files source-dir target-dir)
(for-each delete-it (find-files pollen-related-file? target-dir)) (parameterize ([world:current-project-root (current-directory)])
(for-each delete-it (find-files pollen-related-file? target-dir)))
(displayln (format "completed to ~a" target-dir))) (displayln (format "completed to ~a" target-dir)))
(define (handle-unknown command) (define (handle-unknown command)

@ -238,10 +238,11 @@
(and (directory-exists? path) (and (directory-exists? path)
(or (ends-with? (path->string path) "compiled")))) (or (ends-with? (path->string path) "compiled"))))
(define+provide (cache-file? path)
(or (ends-with? (path->string path) (world:current-cache-filename))))
(define+provide (cache-file? path)
(ormap (λ(cache-name) (ends-with? (path->string path) cache-name)) world:cache-names))
(require sugar/debug)
(define+provide (pollen-related-file? file) (define+provide (pollen-related-file? file)
(ormap (λ(proc) (proc file)) (list (ormap (λ(proc) (proc file)) (list
preproc-source? preproc-source?
@ -253,4 +254,5 @@
null-source? null-source?
racket-source? racket-source?
magic-directory? magic-directory?
cache-file?))) cache-file?
(world:current-unpublished-path?))))

@ -130,3 +130,5 @@ Default separators used in decoding. The first two are initialized to @racket["\
@defoverridable[compile-cache-active boolean?]{Whether the compile cache, which speeds up interactive sessions by saving compiled versions of Pollen source files, is active. Default is active (@racket[#t]).} @defoverridable[compile-cache-active boolean?]{Whether the compile cache, which speeds up interactive sessions by saving compiled versions of Pollen source files, is active. Default is active (@racket[#t]).}
@defoverridable[compile-cache-max-size exact-positive-integer?]{Maximum size of the compile cache. Default is 10 megabytes.} @defoverridable[compile-cache-max-size exact-positive-integer?]{Maximum size of the compile cache. Default is 10 megabytes.}
@defoverridable[unpublished-path? (path? . -> . boolean?)]{Predicate that determines whether a path is omitted from @secref{raco_pollen_publish} operations. If the predicate is @racket[#t], then the path is omitted. The default, therefore, is @racket[#f].}

@ -87,3 +87,5 @@
(define-settable compile-cache-active #t) (define-settable compile-cache-active #t)
(define-settable compile-cache-max-size (* 10 1024 1024)) ; = 10 megabytes (define-settable compile-cache-max-size (* 10 1024 1024)) ; = 10 megabytes
(define-settable unpublished-path? (λ(path) #f))
Loading…
Cancel
Save