Is there an easy method of using your own modules in baba? Say I just wanted to extract some functions, already written, and use them in several scripts…
(like I would use include files in C, for instance)
@schpaencoder Sure. You can make libraries like you would with clj and then add them to your classpath with export BABASHKA_CLASSPATH=$(clojure -Spath ...)
You can use github repositories as dependencies with clojure
.
Another option is to just add your utilities to the classpath with export BABASHKA_CLASSPATH=/home/foobar/babashka_libs
for example
Does the last option require me to create .jar-files or will plain source.clj do?
@schpaencoder It doesn't require you to make .jar files. You can use any directory on the classpath.
Oh, what a relief!
Thanks!
It does follow the convention of clojure in that foo-bar.baz
searches for /foo_bar/baz.clj
right
thank you again, you just saved me some gray hair
:thumbsup:
@schpaencoder The docs for classpath are here: https://github.com/borkdude/babashka#classpath
indeed, I can do this!
I think that the BABASHKA_PRELOADS was the feature I really was looking for
yeah, you can also use that