Are people using babashka to make command-line apps (i.e., more than just personal scripts, ones that are shareable, versioned, etc)? I just came across https://github.com/nubank/docopt.clj, and the first example shows usage babashka. It seems really cool, but it got me wondering how to distribute a util made with babashka. Sharing a gist is the first thing that came to mind 😅 but is there a way to share it as an actual app/executable?
@kiraemclean Welcome! Babashka nowadays has the ability to set the classpath from within a script. Here is an example for camel-snake-kebab: https://github.com/babashka/babashka/blob/master/doc/projects.md#camel-snake-kebab
Feel free to update those docs for docopt as well
oh cool!
thanks.
I was also wondering about how to share/distribute Babashka scripts.. in practice I'm basically trying to decide between making a cli with Clojure and building a native image vs. making a Babashka script (I think I can do everything I want with it, but not actually sure yet). Is that an intended use of Babashka, though? I guess my real question is, is there a good way to package a distribute a Babashka "app", or is that not really what it's for?
apologies for probably missing an obvious answer.. I'm just starting to use Babashka a little bit, but so far only for personal things (which is already amazing!)
It's a very good question. So far people usually put their scripts in a git repo which you can then just clone on your machine, and possibly put it to your $PATH
This is a recent example: https://github.com/robertfw/bunpack
makes sense.. that's a really useful example, thanks!
I've been thinking if we should maybe have some central repo for all kinds of scripts that people can contribute to and selectively install from, but I haven't really thought deeply about it
interesting! that could be cool for sure. I guess at the end of the day if you want a platform-agnostic executable you'll have to just make a native image.. I suppose it could still use Babashka though, or just have it as a dependency that could be managed by brew or other package managers..
yeah, you could also distribute scripts via normal package managers for sure
I guess the solution will work itself out if the script becomes really popular
interesting.. anyway, just got me thinking. I usually put off thinking about how people are actually going to use my code until too late and then regret not making different decisions early on 😆 trying to force myself to finally learn the lesson..
yeah I think you're right.
it totally makes sense not to go crazy with packaging/deployment concerns for experiments.
People sometimes also use gists. Here is one for an http server a la python -m http.server: https://gist.github.com/holyjak/36c6284c047ffb7573e8a34399de27d8 But gists are generally a bit difficult to work with if you want to collaborate
yeah just putting it in a gist was my first thought.. that's usually how I've shared little one off scripts before