ignore "compiled" directories in `directory->pagetree`

pull/111/head
Matthew Butterick 8 years ago
parent e9356f33ec
commit 2afe8bc04d

@ -91,14 +91,15 @@
;; in general we don't filter the directory list for the automatic pagetree.
;; this can be annoying sometimes but it's consistent with the policy of avoiding magic behavior.
;; certain files (leading dot) will be ignored by `directory-list` anyhow.
;; we will, however, ignore Pollen's cache files, because those shouldn't be project-manipulated.
(define (not-pollen-cache? path)
(not (member (->string path) default-cache-names)))
;; we will, however, ignore Pollen's cache files, and Racket's `compiled` dirs,
;; because those shouldn't be project-manipulated.
(define (neither-compiled-nor-cache-dir? path)
(not (member (->string path) (cons "compiled" default-cache-names))))
(unless (directory-exists? dir)
(error 'directory->pagetree (format "directory ~v doesn't exist" dir)))
(decode-pagetree (map ->pagenode (unique-sorted-output-paths (filter not-pollen-cache? (directory-list dir))))))
(decode-pagetree (map ->pagenode (unique-sorted-output-paths (filter neither-compiled-nor-cache-dir? (directory-list dir))))))
(define+provide/contract (get-pagetree source-path)

@ -1 +1 @@
1457655025
1457655648

Loading…
Cancel
Save