wip
This commit is contained in:
parent
c802c1c852
commit
5453a32685
1 changed files with 7 additions and 5 deletions
|
|
@ -1,9 +1,11 @@
|
|||
(ns babashka.utils)
|
||||
|
||||
(defmacro when-graal [& body]
|
||||
(when (resolve 'babashka.impl.Graal)
|
||||
`(do ~@body)))
|
||||
(defmacro if-graal [then else]
|
||||
(if (resolve 'babashka.impl.Graal)
|
||||
~then
|
||||
~else))
|
||||
|
||||
(defn set-env [name value]
|
||||
(when-graal
|
||||
(babashka.impl.Graal/setEnv name value)))
|
||||
(if-graal
|
||||
(babashka.impl.Graal/setEnv name value)
|
||||
(throw (UnsupportedOperationException. "set-env is only available in the native image."))))
|
||||
|
|
|
|||
Loading…
Reference in a new issue