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