diff --git a/pollen/private/file-utils.rkt b/pollen/private/file-utils.rkt index 85b368a..2e41096 100644 --- a/pollen/private/file-utils.rkt +++ b/pollen/private/file-utils.rkt @@ -296,13 +296,20 @@ (and (regexp-match pat str) #t)) -(define+provide (magic-directory? path) - (and (directory-exists? path) - (or (ends-with? (path->string path) "compiled")))) +(define (special-path? path) + (define special-paths (append default-cache-names '("compiled" ".git" ".gitignore" ".hg" ".svn" "CVS"))) + (and (member (path->string (last (explode-path path))) special-paths) #t)) - -(define+provide (cache-file? path) - (ormap (λ(cache-name) (ends-with? (path->string path) cache-name)) default-cache-names)) +(module-test-internal + (require sugar/coerce) + (check-true (special-path? (string->path "foo/pollen-cache"))) + (check-false (special-path? (string->path "foo/bar-pollen-cache"))) + (check-true (special-path? (string->path "compiled"))) + (check-true (special-path? (string->path "foo/compiled"))) + (check-false (special-path? (string->path "foo/rcompiled"))) + (check-true (special-path? (string->path ".git"))) + (check-true (special-path? (string->path "foo/.git"))) + (check-false (special-path? (string->path "foo/robot.git")))) (define+provide (omitted-path? file) @@ -314,12 +321,11 @@ scribble-source? null-source? racket-source? - magic-directory? - cache-file? + special-path? (setup:omitted-path?) - (setup:unpublished-path?)))) + (setup:unpublished-path?)))) ; deprecated name (define+provide (extra-path? file) (ormap (λ(proc) (proc file)) (list (setup:extra-path?) - (setup:extra-published-path?)))) \ No newline at end of file + (setup:extra-published-path?)))) ; deprecated name \ No newline at end of file diff --git a/pollen/private/ts.rktd b/pollen/private/ts.rktd index b641401..c00f03a 100644 --- a/pollen/private/ts.rktd +++ b/pollen/private/ts.rktd @@ -1 +1 @@ -1466283681 +1466709322 diff --git a/pollen/scribblings/raco.scrbl b/pollen/scribblings/raco.scrbl index 0400c94..d23b750 100644 --- a/pollen/scribblings/raco.scrbl +++ b/pollen/scribblings/raco.scrbl @@ -73,7 +73,9 @@ Render all preprocessor source files and then all pagetree files found in the cu This command can be invoked with extra arguments. -@racket[raco pollen render _directory] will perform the render described above, but in the specified directory. By default, only files in the immediate directory are rendered. Adding the optional @exec{-r} or @exec{--recursive} switch will also render subdirectories recursively. +@racket[raco pollen render _directory] will perform the render described above, but in the specified directory. By default, only files in the immediate directory are rendered. + +Adding the optional @exec{-r} or @exec{--recursive} switch will also render subdirectories recursively. Certain directories are automatically omitted from recursive renders, including Pollen caches and source-control directories (like @tt{.git} and @tt{.svn}). You can omit other paths by overriding @racket[default-omitted-path?]. You can override these omissions — that is, force a path to be included in a recursive render — by overriding @racket[default-extra-path?]. Alternatively, the command can take a variable number of path arguments. @racket[raco pollen render _path ...] will render only the paths specified in @racket[_path ...]. Consistent with the usual command-line idiom, this can be a single path, a list of paths, or a pattern: @@ -110,7 +112,7 @@ If you're already in your project directory and want to publish somewhere other You can determine the default publishing destination for a project by overriding @racket[default-publish-directory]. -You can determine the files that get filtered out in a project by overriding @racket[default-omitted-path?]. You can override these filters — that is, force a path to be published — by overriding @racket[default-extra-path?]. +Certain files and directories are automatically omitted from the published directory, including Racket and Pollen sources, Pollen caches, and source-control directories (like @tt{.git} and @tt{.svn}). You can omit other files by overriding @racket[default-omitted-path?]. You can override these omissions — that is, force a path to be published — by overriding @racket[default-extra-path?]. @section{@exec{raco pollen setup}}