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)
|
(ns babashka.utils)
|
||||||
|
|
||||||
(defmacro when-graal [& body]
|
(defmacro if-graal [then else]
|
||||||
(when (resolve 'babashka.impl.Graal)
|
(if (resolve 'babashka.impl.Graal)
|
||||||
`(do ~@body)))
|
~then
|
||||||
|
~else))
|
||||||
|
|
||||||
(defn set-env [name value]
|
(defn set-env [name value]
|
||||||
(when-graal
|
(if-graal
|
||||||
(babashka.impl.Graal/setEnv name value)))
|
(babashka.impl.Graal/setEnv name value)
|
||||||
|
(throw (UnsupportedOperationException. "set-env is only available in the native image."))))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue