Fork me on GitHub
#kaocha
<
2020-05-25
>
miikka05:05:16

Funnel looks nice

defa06:05:53

How to run kaocha when there is a main-namespace defined in one of the aliases? My kaocha.sh script looks like this

#!/usr/bin/env bash
clojure -A:shared:server -m kaocha.runner "$@"
and in deps.edn there is a :main-opts ["-m" "server"] defined for the server alias. Now when running the script, the server gets started instead of kaocha. So the -m option to clojure is obviously ignored. Is there a ways without introducing an additional alias in deps.edn?

plexus07:05:58

I think you can use -C:shared:server instead of -A:, have a look at clojure --help. You can control which part of the aliases gets used (extra-paths, mains, deps). -C will only handle the classpath, -A does everything

defa12:05:08

@plexus Thanks, must have overlooked this option, but it seems not to be that easy:

java.lang.IllegalArgumentException: No implementation of method: :as-file of protocol: #' found for class: clojure.lang.PersistentVector
 at clojure.core$_cache_protocol_fn.invokeStatic (core_deftype.clj:583)
    $fn__11366$G__11348__11371.invoke (io.clj:35)
… will look into that later, not sure what causes this error.

plexus12:05:11

hmmm you have a vector somewhere where something is expecting it to be a filename or something similar

defa12:05:00

Right, there was a typo in my tests.edn … and using a combination of -C and -A did the trick, thanks:

#!/usr/bin/env bash
clojure -A:shared -C:server -m kaocha.runner "$@"