~subsetpark/bagatto

742bfbf0003c3f7eb59b1eb595bff6a0bb7212bc — Zach Smith 2 months ago 11e6e6d master
Just create a new path cache in HoF, silly!
2 files changed, 12 insertions(+), 5 deletions(-)

M src/core.janet
M src/writers.janet
M src/core.janet => src/core.janet +3 -4
@@ 79,7 79,6 @@
  ```
  [output-dir writer-specs]

  (let [handler (writers/write-handler output-dir @{})]
    (printf "Writing %d output specs..." (length writer-specs))
    (ev-utils/pmap handler writer-specs)
    (printf "Done writing.")))
  (printf "Writing %d output specs..." (length writer-specs))
  (ev-utils/pmap (writers/write-handler output-dir) writer-specs)
  (printf "Done writing."))

M src/writers.janet => src/writers.janet +9 -1
@@ 15,7 15,15 @@
      (put cache s true))))

(defn write-handler
  [output-dir path-cache]
  ``
  Return a function that accepts to kinds of messages:
  - `:write path contents`
  - `:copy from to`

  And performs the appropriate file operation, relative to `output-dir`.
  ``
  [output-dir]
  (def path-cache @{})

  (fn handler
    [msg]