babashka

https://github.com/babashka/babashka. Also see #sci, #nbb and #babashka-circleci-builds .
nate 2020-12-27T03:10:48.397500Z

oh man, I used https://github.com/weavejester/progrock for the first time and it's amazing how nice it is to have a progress bar in my scripts (script is binning picture files into directories by year/month):

$ bin-pics
inspecting 253 files...
253/253   100% [==================================================]  ETA: 00:00
copying 221 images...
221/221   100% [==================================================]  ETA: 00:00

👍 3
🎉 3
2020-12-27T15:13:53.398100Z

Hey, I’m trying to build a toy static site generator with bb and hooking up selmer with deps/add-deps but got error “couldn’t resolve symbol thread-bound?” Is there any workaround?

borkdude 2020-12-27T15:27:22.398900Z

@romantsopin Not all libraries are compatible with babashka. I think your best bet in using selmer is via bootleg as a pod: https://github.com/retrogradeorbit/bootleg#babashka-pod-usage

borkdude 2020-12-27T15:27:56.399700Z

Please do report incompatibilities with clojure, such as the one you have encountered and they may get fixed in the new release

2020-12-27T15:28:37.400200Z

Yea, I thought it’s quite common, so there should be a simple way :) thank you!

borkdude 2020-12-27T15:28:39.400400Z

A peek of what is coming in 0.2.6: https://book.babashka.org/master.html#_pod_registry This should work with babashka master (available on #babashka_circleci_builds)

borkdude 2020-12-27T15:31:01.400800Z

Btw, comb is a templating library that does work with bb: https://github.com/borkdude/babashka/blob/master/doc/projects.md#comb

👍 1
borkdude 2020-12-27T15:32:39.401400Z

(require '[babashka.deps :as deps])

(deps/add-deps '{:deps {comb/comb {:mvn/version "0.1.1"}}})

(require '[comb.template :as template])

(template/eval "<% (dotimes [x 3] %>foo<% ) %>")
^ @romantsopin

2020-12-27T15:34:16.401500Z

That’s what I’m looking for!

2020-12-27T16:09:36.401900Z

This is great, and the example is also one of the most featured request haha

2020-12-27T16:19:39.404200Z

Also another question, maybe there is a common way to watch directory and run a command on change? Something similar to hawk (which seems like incompatible)

borkdude 2020-12-27T16:21:26.404500Z

@romantsopin This is also supported via a pod. https://github.com/babashka/pod-babashka-filewatcher

👍 1
borkdude 2020-12-27T16:22:02.405100Z

I'm using it to preview the babashka documentation while writing: https://github.com/babashka/book/blob/master/script/watch.clj

2020-12-27T16:23:38.406300Z

Great, will try it out

borkdude 2020-12-27T16:23:49.406700Z

We are working on making pods installable from a central pod registry from within bb itself, it will take a few days. For now install via brew if you're on linux or macos or download manually