removed duplicated code
This commit is contained in:
parent
42de012fb4
commit
d2b7b86e0b
1 changed files with 6 additions and 22 deletions
|
@ -165,28 +165,12 @@
|
||||||
& {:keys [from-cp from-fs]
|
& {:keys [from-cp from-fs]
|
||||||
:or {from-cp true
|
:or {from-cp true
|
||||||
from-fs true}}]
|
from-fs true}}]
|
||||||
(loop [paths paths
|
(map #(:path %)
|
||||||
result []]
|
(get-resources-recursive
|
||||||
(if (not (empty? paths))
|
fs-prefix base-path paths
|
||||||
(do
|
|
||||||
(let [path-to-work-with (first paths)
|
|
||||||
resource-to-work-with (resource-from-cp-or-fs
|
|
||||||
fs-prefix
|
|
||||||
base-path
|
|
||||||
path-to-work-with
|
|
||||||
:from-cp from-cp
|
:from-cp from-cp
|
||||||
:from-fs from-fs)
|
:from-fs from-fs))
|
||||||
result (into result [path-to-work-with])]
|
)
|
||||||
(cond
|
|
||||||
(nil? resource-to-work-with) []
|
|
||||||
(= :file (:resource-type resource-to-work-with)) (recur (drop 1 paths) result)
|
|
||||||
:else
|
|
||||||
(recur (into (drop 1 paths)
|
|
||||||
(map #(str path-to-work-with "/" %)
|
|
||||||
(.list (:file resource-to-work-with))))
|
|
||||||
result)
|
|
||||||
)))
|
|
||||||
result)))
|
|
||||||
|
|
||||||
; TODO: Add files to keep
|
; TODO: Add files to keep
|
||||||
(s/defn delete-resource-recursive!
|
(s/defn delete-resource-recursive!
|
||||||
|
|
Loading…
Reference in a new issue