Fork me on GitHub
#leiningen
<
2016-03-28
>
kardan07:03:34

Is there a way to pass code to be evaluated to "lein repl" ?

kardan07:03:10

The context is that I have a fn "migrate" which I would like to fire off from a dev provision shell script.

darwin07:03:48

@kardan: you could use :repl-options {:init …} maybe? you won’t be directly able to eval something as it would be typed in the repl, but it could work for your scenario, you can run some code PRIOR repl start

darwin07:03:50

A more advanced solution would be something like what I did in Dirac Agent[1]. I start a nREPL, run my init code on a separate thread, which waits for nREPL to fully start, then connects to it and can do some work there over an nREPL session. But this feels like too much for your situation. [1] https://github.com/binaryage/dirac/blob/master/src/agent/dirac/agent_impl.clj#L140

kardan07:03:28

@darwin: double posted in general and go some answers there to. Thanks for the tip!