Fork me on GitHub
#boot
<
2017-08-25
>
nha20:08:21

Why is the following task not writting a file in my '/target' folder?

(deftask create-file
  []
  (let [tmp-main (core/tmp-dir!)]
    (fn middleware [next-handler]
      (fn handler [fileset]
        (core/empty-dir! tmp-main)
        (let [out (io/file tmp-main "some_file.txt")]
          (util/info "Creating a file %s ... \n" (.getPath out)) ;; /Users/nha/.boot/cache/tmp/ ... /10sx/-skza10/some_file.txt
          (spit out "CONTENT !"))
        (-> fileset
            (core/add-source tmp-main)
            core/commit!
            next-handler)))))
I call it from the repl:
(boot (create-file) (target))

nha20:08:30

add-resource worked, thanks Juho!

nha20:08:32

(although add-asset is really what I am after)