Is there a way using deps.edn
to add code that gets eval'd on startup for an alias or for a repl launched using clj
? The problem I'm specifically trying to solve is requiring jansi-clj
for any terminal clojure session so it picks up my system terminal colors, but I was wondering if there was a generally recommended approach to the problem of "default startup code" using tools-deps
.
you can use clojure.main's -i or -e sometimes for things likee this
clj -h
will tell you more
-i loads an arbitrary clj file, -e runs an expression
got it, so it's the simple matter of combining -e (require 'jansi-clj.auto) -r
to launch a repl with some short startup code, and -i "/path/to/file" -r
for anything longer. thanks!
yep, and you can put that in an alias with :main-opts
so clj -A:repl
or whatever