This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-05-28
Channels
- # announcements (2)
- # aws (21)
- # babashka (4)
- # babashka-sci-dev (17)
- # beginners (3)
- # cider (16)
- # clj-kondo (61)
- # clojure (122)
- # clojure-europe (11)
- # clojure-spec (3)
- # clojurescript (2)
- # conjure (19)
- # helix (9)
- # hyperfiddle (2)
- # inf-clojure (18)
- # lsp (12)
- # off-topic (15)
- # react (2)
- # releases (1)
- # shadow-cljs (40)
- # spacemacs (4)
- # tools-deps (5)
- # vim (15)
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!)One of those cases where the answer (or rather: the problem) was right in front of me the whole time. 😂