Check that cache dir is writable before writing (#47)
...pod metadata cache file
This commit is contained in:
parent
c2d6ba847c
commit
aee5337cef
1 changed files with 5 additions and 3 deletions
|
|
@ -2,7 +2,8 @@
|
||||||
(:require [babashka.pods.impl :as impl]
|
(:require [babashka.pods.impl :as impl]
|
||||||
[sci.core :as sci]
|
[sci.core :as sci]
|
||||||
[clojure.java.io :as io]
|
[clojure.java.io :as io]
|
||||||
[babashka.pods.impl.resolver :as resolver])
|
[babashka.pods.impl.resolver :as resolver]
|
||||||
|
[babashka.fs :as fs])
|
||||||
(:import (java.io PushbackInputStream File)))
|
(:import (java.io PushbackInputStream File)))
|
||||||
|
|
||||||
(set! *warn-on-reflection* true)
|
(set! *warn-on-reflection* true)
|
||||||
|
|
@ -45,8 +46,9 @@
|
||||||
cache-file (when cache (metadata-cache-file bb-edn-file pod-spec opts))]
|
cache-file (when cache (metadata-cache-file bb-edn-file pod-spec opts))]
|
||||||
(when cache-file
|
(when cache-file
|
||||||
(io/make-parents cache-file)
|
(io/make-parents cache-file)
|
||||||
(with-open [w (io/output-stream cache-file)]
|
(when (fs/writable? (fs/parent cache-file))
|
||||||
(impl/write w metadata)))
|
(with-open [w (io/output-stream cache-file)]
|
||||||
|
(impl/write w metadata))))
|
||||||
metadata))
|
metadata))
|
||||||
|
|
||||||
(defn load-pod-metadata
|
(defn load-pod-metadata
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue