babashka 2026-08-25

I'm happily scripting away with bb, and I'm looking for a way to test the babashka version programmatically those scripts, so I can distribute them and they exit if the babashka version isn't new enough. Is something like that already built-in, or do I have to split and parse the babashka.version system property myself?

At the moment the latter

Thanks! Perhaps I can contribute some code.

Not high priority at the moment. bb.edn does have min-bb-version

Yeah, that's why I thought I was missing something.

Github issue first is the way, then we can collect feedback before adding premature code

Sure, this ain't my first rodeo 😛

😅 1

part of me wonders if there's a really light semver-ish lib that could maybe be a candidate for inclusion... in addition to this case, I wonder if that'd be a welcome general addition for bumping versions as part of build tasks and what-not

the last part of the bb version number will be always increasing

so it's quite easy to do the check yourself now]

I've used version-clj in the the past for this, it works in bb user space

You can now do this in bb:

(require '[clojure.tools.deps.extensions :as ext]
         '[clojure.tools.deps.extensions.maven])  ; registers the :mvn methods

(defn compare-mvn-versions
  [a b]
  (ext/compare-versions 'x/x {:mvn/version a} {:mvn/version b} nil))

(compare-mvn-versions "1.9.0" "1.10.0")   ;=> -1
(sort compare-mvn-versions ["1.10.0" "1.2.0-SNAPSHOT" "1.2.0" "1.9.0"])
;=> ("1.2.0-SNAPSHOT" "1.2.0" "1.9.0" "1.10.0")

👏 1