Is there a way in babashka to ensure a minimal version is installed locally?
@ben.sless there is an issue for this but not implemented yet
I find I'm trying to implement it, one hangup I'm faced with is finding the bb
executable's path
There is a system property you can check though: babashka.version
I wonder what should happen on a lower version, throw? Only a warning? How does lein handle this?
It can by definition only be a forward-compatible feature, no?
Just add a new command
The bb executable path: I asked about this in the GraalVM slack and someone said Graal had some API for it. I havenโt found it though
we can cheat by searching for the bb
executable in path
The issue proposes a property in bb.edn like lein
The bb exec path can be found using fs/which
Afk now, back later tonight
๐
Rough sketch for an upgrade task with optional minimal version requirement. Let me know how fragile you think this is when you can
@ben.sless A few thoughts:
The thing I had in mind is just the :min-bb-version
in bb.edn
:
https://github.com/babashka/babashka/issues/663
like lein
does it. Just print a warning to stderr when you don't have the right version.
How to upgrade depends on how people installed babashka. You don't want to upgrade bb outside of the package manager if you installed it with a package manager I think?
So how to upgrade is probably a custom script that you will have locally (like the one you have) or curl-bash the standard *nix/macos install script.
Another point is that bash is linux/macos specific and bb also supports Windows, so if we would have an upgrade command, it should not depend on a bash script. The binaries on Github are in predictable locations, so it's doable to all do that from Clojure.