From e8ca180529cebe55abd6f463738342a5680e624d Mon Sep 17 00:00:00 2001 From: Michiel Borkent Date: Fri, 29 Jul 2022 13:09:00 +0200 Subject: [PATCH] make compatible with init --- src/babashka/impl/tasks.clj | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/babashka/impl/tasks.clj b/src/babashka/impl/tasks.clj index 830bcb77..3924672a 100644 --- a/src/babashka/impl/tasks.clj +++ b/src/babashka/impl/tasks.clj @@ -458,9 +458,10 @@ (sci/eval-string* @ctx expr)))) (defn ^:macro exec - ([_ _ fq-sym] - (let [ns (namespace fq-sym) - var-name (name fq-sym) + ([_ _ sym] + (let [ns (namespace sym) + ns (or ns (symbol (str @sci/ns))) + var-name (name sym) snippet (cli/exec-fn-snippet ns var-name)] `(load-string ~snippet))))