Fork me on GitHub

I finally have a use case for using sci interpretation from within babashka! I'd like to make bink link providers more flexible. Right now, the only supported provider is :edn-file. - read EDN-formatted local file. I'd like to add a :sci-fn link provider. Draft for bink config format:

{:providers {clojure-community {:edn-file
                                {:path "~/.config/bink/provider/clojure.edn"}}
             stuff-from-work {:sci-fn
                              (fn []
                                 (slurp "")
I asked about the ability to shell interpret Clojure with sci from babashka scripts a while ago, borkdude, and I think your reply was along the lines of "this is not yet supported, but could be considered". What are your thoughts now? This is absolutely not urgent. Simply adding link providers for {:slurp-edn {:url ""}} and {:slurp-json {:url ""}} would solve all my immediate needs. Shelling out to babashka is another option. Then I could also use all of babashka's default provided namespaces (like json for cheshire).

πŸ‘€ 1

Why not just use load-string?


That's a very good point. I need to trust the code in the file regardless, so I won't get any security advantages by using sci over load-string.


Load-string does indeed work for this!


I decided to follow up on this track. I've got something working, but I'm not sure it's good for anyone else yet. I can now use this config file:

;; now in ~/.config/dbx/dbx.edn
{:providers {iterbart {:fn (fn []
                             (:links (cheshire.core/parse-string
                                      (slurp "")
                       :embark-fn (fn [url]
                                    (babashka.process/process ["firefox" "-new-window" url]))}}}
with this script: --- I'm going to try using it for a bit myself before moving any further. The CLI is simple:
dbx provider # list providers
dbx nav # pick provider, then target, then embark
dbx nav PROVIDER # pick target, then embark.


[email protected] has been released, which means it's time for the first public announcement! πŸŽ‰

πŸŽ‰ 10
πŸ‘ 1

This is great stuff! It’s not immediately clear, so what do I need to do to get my software onto bbin?


Good question β€’ If your project has a deps.edn file, you can install it using the --git/url, --mvn/version, or --local/root options, which should be familiar if you've used the Clojure CLI tools β—¦ If your project is on GitHub, you can omit --git/url using the io.github.proj/repo syntax β€’ If you have a standalone .clj script, you can push it to GitHub and install it from the raw HTTP URL β—¦ Installing .clj files from the local filesystem is not implemented yet, but will be supported in the future Edit: I created a FAQ page with a little more info:


Im trying to setup a babashka task like

{:min-bb-version "0.4.0"
 :tasks {fmt (shell "lein zprint $(git ls-files)")}}
but its failing with
Processing file: `$(git
Unable to process file: `$(git because: `$(git (No such file or directory) Leaving it unchanged!
Processing file: ls-files)`
Unable to process file: ls-files)` because: ls-files)` (No such file or directory) Leaving it unchanged!
is the shell fn able to do the expansion for me?


@plins No, it doesn't do bash expansion since bb is fully cross platform compatible and bash is not. You can do it like this:

(let [files (str/split-ilnes (:out (shell {:out :string} "git ls-files"))] ...)
or so


and then (apply shell "lein zprint" files)


(you might need to get rid of the last newline in the git output)


An antq script you can install with bbin:

bbin install 
Then run antq --help or just antq to see upgradable deps

πŸ†’ 2

This issue for installing multiple scripts from a single repo may be relevant for the borkdude/tools repo: