Skip to content

Instantly share code, notes, and snippets.

@stuarthalloway
Created August 17, 2016 12:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stuarthalloway/072cf989c509dc78b4d08463fc4975f3 to your computer and use it in GitHub Desktop.
Save stuarthalloway/072cf989c509dc78b4d08463fc4975f3 to your computer and use it in GitHub Desktop.
add-at, take 1
;; non-working add-at
(require '[boot.core :as core]
'[boot.tmpdir :as tmpd]
'[clojure.java.io :as io])
(deftask add-at
"Like sift :add-*, but lets you make a dest path in fileset"
[r rolekey ROLEKEY kw "rolekey"
s source SOURCE file "source path in project"
d dest DEST file "dest path in fileset"]
(fn [next-task]
(fn [fileset]
(next-task (tmpd/add fileset
(io/file
(#'core/get-add-dir fileset #{rolekey})
dest)
source
nil)))))
(boot (add-at :rolekey :asset
:source (io/file "foo")
:dest (io/file "bar"))
(target))
;; AssertionError Assert failed: dest-dir not in dir set (/Users/stu/.boot/cache/tmp/meta/datomic-dev/jcp/-rcsl8f/bar)
;; ((set (map file dirs)) dest-dir) boot.tmpdir.TmpFileSet (tmpdir.clj:276)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment