Created
March 2, 2011 13:23
-
-
Save timvisher/850917 to your computer and use it in GitHub Desktop.
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
(defn do-copy-tree [from to include-globs] | |
(let [globs-pattern (globs->pattern include-globs) | |
src-paths (map fs/normpath (filter #(re-matches globs-pattern (.getName %)) (file-seq (io/as-file from)))) | |
from (fs/normpath from) | |
to (fs/normpath to) | |
dest-paths (map #(.replaceFirst % from to) src-paths)] | |
(doall (map fs/copy+ src-paths dest-paths)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment