Fork me on GitHub
#beginners
<
2022-05-28
>
Stef Coetzee07:05:23

What makes a function an invalid exec function when using Clojure CLI's -X execution option? One way is shown below. This works: clj -X webdev.core/-dev-main :port 8000 This results in the error "Invalid exec function: webdev.core/-dev-main": clj -X:dev , where dev is an alias defined in deps.edn:

;; deps.edn

{:paths   ["src"]
 
 :deps    {ring/ring {:mvn/version "1.9.5"}}
 
 :aliases {:dev {:exec-fn "webdev.core/-dev-main"
                 :exec-args {:port 8000}}}}
The :exec-fn key's value, "webdev.core/-dev-main", is wrapped in double quotes. Dunno why I did that. Anyway, removing the quotes allows clj -X:dev to be used in place of typing out the whole command. (Mostly posting for future-me's sake. Hopefully it benefits others, too!)

Ben Sless08:05:18

I think the exec fn in the alias needs to be a symbol, not a string

👍 1
Stef Coetzee09:05:33

One of those cases where the answer (or rather: the problem) was right in front of me the whole time. 😂