babashka

https://github.com/babashka/babashka. Also see #sci, #nbb and #babashka-circleci-builds .
pez 2021-01-08T07:59:18.041100Z

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.

pez 2021-01-08T08:00:12.041900Z

That pythonic way of checking if I am running in the REPL works perfectly. Thanks!

borkdude 2021-01-08T10:16:34.042600Z

Print API breakage warnings using a 75-line bb script: https://gist.github.com/borkdude/ba372c8cee311e31020b04063d88e1be

😎 6
2021-01-08T11:59:03.043Z

Nice!

2021-01-08T12:00:07.044500Z

Would be interesting to have a registry for these "one time" scripts. Clojure toolbox needs a modern successor maybe

borkdude 2021-01-08T12:26:24.044800Z

@jeroenvandijk I'm posting them here as well: https://github.com/borkdude/babashka/blob/master/doc/news.md

borkdude 2021-01-08T12:26:57.045Z

and also some things here: https://github.com/borkdude/babashka/blob/master/doc/projects.md

2021-01-08T14:13:10.045200Z

Cool, that’s useful!

wilkerlucio 2021-01-08T15:09:36.046800Z

@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 πŸ™

❀️ 3
☝️ 3
borkdude 2021-01-08T19:03:37.048100Z

Welcome @d.wetzel86!

NPException 2021-01-08T19:17:34.048400Z

Hello! πŸ‘‹

2021-01-08T21:04:30.049500Z

@borkdude Hi! Babashka and clj-kondo are really useful tools and I appreciate the work you've put into them!

borkdude 2021-01-08T21:04:48.049700Z

thanks!

2021-01-08T21:33:28.050Z

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?

borkdude 2021-01-08T21:45:09.050700Z

@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

2021-01-08T21:45:32.051100Z

Thanks, I'll take a look at that.

borkdude 2021-01-08T21:47:20.051700Z

For full interactivity, start the process with (process ["psql"] {:inherit true})

borkdude 2021-01-08T21:48:03.052600Z

And then you might want to deref the result of that, else the script will exit immediately, since process isn't blocking

borkdude 2021-01-08T21:49:02.053200Z

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

borkdude 2021-01-08T21:49:35.053800Z

And honeysql also works with bb as a lib, if you want to do that kind of thing

2021-01-08T21:50:43.054200Z

using bb/process worked right away, thanks again.

2021-01-08T21:52:25.054800Z

pods are great too btw, I used the aws one in this script and it was so easy :thumbsup:

πŸ‘ 2