Created
August 17, 2016 12:44
-
-
Save stuarthalloway/072cf989c509dc78b4d08463fc4975f3 to your computer and use it in GitHub Desktop.
add-at, take 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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