Back
copy (clj)
(source)function
(copy src dest)
(copy src dest {:keys [replace-existing copy-attributes nofollow-links]})
Copies src file to dest dir or file.
Options:
* `:replace-existing`
* `:copy-attributes`
* `:nofollow-links` (used to determine to copy symbolic link itself or not).
Examples
babashka/babashka
(ns built-in
(:require [babashka.fs :as fs]
[babashka.process :refer [shell]]))
;; copy clojure spec as built-in
(fs/with-temp-dir [tmp-dir {}]
(let [tmp-dir (fs/file tmp-dir)]
(shell {:dir tmp-dir} "git clone https://github.com/babashka/spec.alpha")
(let [spec-dir (fs/file tmp-dir "spec.alpha")]
(shell {:dir spec-dir} "git reset 951b49b8c173244e66443b8188e3ff928a0a71e7 --hard")
(fs/copy-tree (fs/file spec-dir "src" "main" "clojure") (fs/file "resources" "src" "babashka")
{:replace-existing true}))))
dundalek/dinodoc
(ns doc
(:require
[babashka.fs :as fs]
[clojure.string :as str]
[dinodoc.api :as dinodoc]))
(fs/copy-tree "reitit/doc/images" "docs/images")