Merge remote-tracking branch 'origin/mob-session' into mob-session2
This commit is contained in:
commit
636bfc6f41
1 changed files with 12 additions and 16 deletions
|
@ -51,25 +51,21 @@
|
||||||
|
|
||||||
(defn copy-dir
|
(defn copy-dir
|
||||||
[source-dir target-dir ignore-patterns]
|
[source-dir target-dir ignore-patterns]
|
||||||
(loop [l-source-list (.list source-dir)
|
(loop [source-list (.list source-dir)
|
||||||
l-source-dir source-dir
|
file-path-prefix [""]]
|
||||||
l-target-dir target-dir]
|
(let [f (first source-list)
|
||||||
(println (str "source-dir: " source-dir " target-dir: " target-dir " f: ") (first l-source-list) " second: " (second l-source-list))
|
second? (not (nil? (second source-list)))
|
||||||
(let [f (first l-source-list)
|
target-file (io/file target-dir (str (first file-path-prefix) f))
|
||||||
second? (not (nil? (second l-source-list)))
|
source-file (io/file source-dir (str (first file-path-prefix) f))]
|
||||||
target-file (io/file target-dir f)
|
|
||||||
source-file (io/file source-dir f)]
|
|
||||||
; TODO: .isFile is called on wrong path to the actual file, does not consider the path leading to the subdirectory of the file
|
|
||||||
(println "type of f: " (type f))
|
|
||||||
(if (.isFile source-file)
|
(if (.isFile source-file)
|
||||||
(do
|
(do
|
||||||
(copy-file f target-file)
|
(copy-file source-file target-file)
|
||||||
;; continue copying files
|
|
||||||
(when second?
|
(when second?
|
||||||
(recur (drop 1 l-source-list) source-dir target-dir)))
|
(recur (drop 1 source-list) (drop 1 file-path-prefix))))
|
||||||
;; recur down to contained directory
|
(when (> (count (.list source-file)) 0)
|
||||||
(do (println (type (.list source-file)))
|
(recur (concat (.list source-file) (drop 1 source-list))
|
||||||
(when second? (recur (concat (.list source-file) (drop 1 l-source-list)) source-file target-file)))))))
|
(concat (repeat (count (.list source-file)) (str (first file-path-prefix) f "/"))
|
||||||
|
(drop 1 file-path-prefix))))))))
|
||||||
|
|
||||||
(defn copy-resources
|
(defn copy-resources
|
||||||
[fs-prefix source-path target-path ignore-patterns]
|
[fs-prefix source-path target-path ignore-patterns]
|
||||||
|
|
Loading…
Reference in a new issue