add file-exists? fn
This commit is contained in:
parent
75ac524736
commit
03058f574f
|
@ -5,6 +5,11 @@
|
||||||
(:require [com.ashafa.clutch :as couch]
|
(:require [com.ashafa.clutch :as couch]
|
||||||
[clojure.java.io :as io]))
|
[clojure.java.io :as io]))
|
||||||
|
|
||||||
|
(defn file-exists? [file]
|
||||||
|
(let [f (ensure-prefix file "/")]
|
||||||
|
(couch/with-db files
|
||||||
|
(not (zero? (count (couch/get-view "files" "listPublished" {:key f})))))))
|
||||||
|
|
||||||
(defn get-file [file]
|
(defn get-file [file]
|
||||||
(let [f (ensure-prefix file "/")]
|
(let [f (ensure-prefix file "/")]
|
||||||
(couch/with-db files
|
(couch/with-db files
|
||||||
|
|
Reference in a new issue