I had of course checked the book. π But too briefly. I was wishing for a pythonic way to do it, but didnβt think of searching for python or main. Haha.
That pythonic way of checking if I am running in the REPL works perfectly. Thanks!
Print API breakage warnings using a 75-line bb script: https://gist.github.com/borkdude/ba372c8cee311e31020b04063d88e1be
Nice!
Would be interesting to have a registry for these "one time" scripts. Clojure toolbox needs a modern successor maybe
@jeroenvandijk I'm posting them here as well: https://github.com/borkdude/babashka/blob/master/doc/news.md
and also some things here: https://github.com/borkdude/babashka/blob/master/doc/projects.md
Cool, thatβs useful!
@borkdude awesome thing on the API breakage! man, I just wanna say I'm very thankful for all the work you have been doing with kondo, babashka, sci, etc... fews like a new Clojure era, getting improved in exponential rates, and I can't live without all of them anymore! so thank you very much π
Welcome @d.wetzel86!
Hello! π
@borkdude Hi! Babashka and clj-kondo are really useful tools and I appreciate the work you've put into them!
thanks!
I've been poking around a bit and haven't been able to figure this out: I'm making a bb script that wraps psql; I'd like the script to start an interactive psql session. Using clojure.java.shell, the script runs psql but then exits immediately. Is there documentation for how to do this type of thing?
@tomc yes, you can start an interactive process using babashka.process
. clojure.java.shell isn't really suited for this.
https://github.com/babashka/process
Thanks, I'll take a look at that.
For full interactivity, start the process with (process ["psql"] {:inherit true})
And then you might want to deref
the result of that, else the script will exit immediately, since process
isn't blocking
Note that there is also a postgresql pod for babashka: https://github.com/babashka/babashka-sql-pods/ available in the pod registry for easy download: https://github.com/babashka/pod-registry
And honeysql also works with bb as a lib, if you want to do that kind of thing
using bb/process worked right away, thanks again.
pods are great too btw, I used the aws one in this script and it was so easy :thumbsup: