Fork me on GitHub
#tools-deps
<
2021-03-06
>
roklenarcic15:03:15

Are key values for -X not automatically strings? I’m doing the call:

clj -X:deploy :artifact "cljc-shuffle.jar"
And I’ve noticed that slipset/deps-deploy i am running is explicitly converting :artifact value to string, via (str artifact)

borkdude15:03:01

No, this is very annoying, you have to write '"foo"'

roklenarcic16:03:19

so what does foo produce in the program? A symbol foo?

alexmiller17:03:33

all args are read as edn strings

roklenarcic17:03:30

How do cmd line args and :exec-args combine? I’ve had this:

:deploy {:extra-deps {slipset/deps-deploy {:mvn/version "0.1.5"}}
           :exec-fn deps-deploy.deps-deploy/deploy
           :exec-args {:installer :remote :artifact "cljc-shuffle.jar"
                       :sign-releases? true}}
If I run, clj -X:deploy it worked. Then I tried to specify artifact on cmd. So I removed it from deps and ran: clj -X:deploy :artifact "'cljc-shuffle.jar'" and then I get
Execution error (IllegalArgumentException) at java.lang.reflect.Array/set (Array.java:-2).
array element type mismatch

roklenarcic17:03:44

do command line arguments replace :exec-args in full?

seancorfield17:03:35

No they are additive. I would have expected that to work

seancorfield17:03:32

Oh wait, no. Your arg is wrong.

seancorfield17:03:54

Use '"string"'

seancorfield17:03:51

Strings require double quotes. Then you need single quotes around that for the shell

seancorfield18:03:31

FYI to tool authors, such as @slipset since deps-deploy was mentioned, for convenience of use I have been allowing symbols where strings are expected so that if users could write the argument without quotes, they are able to do so. For a local JAR file such as cljc-shuffle.jar you could just pass a symbol in and the code could convert the symbol to a string. Obviously, if you're passing in a path, that's generally not going to be a legal symbol and you are going to have to quote ' and double-quote " it.

roklenarcic19:03:56

Ah yes, the symbol fix isn’t released yet for deps-deploy