access to env
This commit is contained in:
parent
609358b057
commit
e9011773e7
1 changed files with 10 additions and 0 deletions
|
@ -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)]
|
||||
|
|
Loading…
Reference in a new issue