access to env

This commit is contained in:
Michael Jerger 2024-10-04 17:23:02 +02:00
parent 609358b057
commit e9011773e7

View file

@ -22,6 +22,16 @@
:debug false
:dry-run false})
(defn-spec env-or-file string?
[name string?]
(let [from-env (System/getenv name)
name-from-file (System/getenv (str name "_FILE"))]
(cond
(some? from-env) from-env
(some? name-from-file) (slurp name-from-file)
:else (throw (RuntimeException.
(str "Environment: [" name "," name-from-file "] was missing."))))))
(defn-spec clean-build-dir! nil?
[devops ::devops]
(let [final (merge default devops)]