Fork me on GitHub

How can I sepcify different comands for jackin. Currently for shadow it is:

npx shadow-cljs -d cider/cider-nrepl:0.27.4 watch :app
I’d like it to be
npx shadow-cljs -d cider/cider-nrepl:0.27.4 watch :app <some-args>
Along with this doc, I thought the original command might come from but I didn’t find the word watch.


There is no way to do this with jack-in currently. You will have to use connect.


Please file an issue about it.


<!subteam^S03BGSAUPTQ|@calva-team> since we are building a command line as an array which we then execute. Maybe a way to solve this more general case is to make the command line array itself configurable? That would then be used instead of Calva building it. We could have some place-holder variables for the dependencies. So in the case above, the user would use a custom connect sequence with something like so in it:

"jack-in-command-line": ["npx", "shadow-cljs", "-d", "$CIDER-NREPL-VERSION", "watch", ":app", "some-arg-1", "some-arg-2"]
It would become a bit tricky to construct the command line for Leiningen and deps.edn this way, but we could make a convenience command for copying out the jack-in command as an array, to start off with. The user can then also specify a custom script:
"jack-in-command-line": ["", "$CIDER-NREPL-VERSION"]
And if we execute the command with some environment variables for the dependencies and middlewares, the user can use those in their script and the command-line would be only:
"jack-in-command-line": [""]
In combination with the current ways to provide jackInEnv, this should provide a lot of flexibility, I think.

Cora (she/her)15:04:21

maybe prefix the env vars with CALVA_

Cora (she/her)15:04:01

but otherwise that sounds good to me

Cora (she/her)15:04:23

I like escape hatches like that that give you total control


Yes, those vars should be properly prefixed of course. $CIDER-NREPL-VERSION above is not an env var, just to clarify.

Cora (she/her)15:04:35

oh absolutely, but even in that case prefixes prevent possible overlap, like namespacing keys

Cora (she/her)15:04:14

I really like this idea. it was forever a pain in emacs that it wasn't simple to override these things


Not sure I follow, please elaborate some.


To have developers as the end users does provide room for some solutions that would be a bit crazy otherwise. 😃

😆 1

I like the idea as well

metal 2
Cora (she/her)15:04:43

I mean with the variables we'll interpolate into their command array it still pays to prefix with CALVA since it's possible that any other value could be a legitimate value they don't want interpolated


I assumed we couldn't get variables in the array interpolated by the shell. You think we can? Then we don't need to interpolate at all. Just execute with env vars and the user can use them either in the array or inside some script.

Cora (she/her)15:04:18

no, I meant outside the shell


No harm in namespacing i feel like