This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-01-05
Channels
- # announcements (2)
- # babashka (23)
- # beginners (67)
- # biff (4)
- # calva (19)
- # cider (6)
- # clj-kondo (40)
- # clj-yaml (14)
- # clojure (3)
- # clojure-austin (13)
- # clojure-europe (18)
- # clojure-nl (1)
- # clojure-norway (26)
- # clojure-uk (5)
- # clojurescript (42)
- # datascript (2)
- # datomic (6)
- # emacs (32)
- # graalvm (8)
- # humbleui (12)
- # hyperfiddle (13)
- # jobs (5)
- # lambdaisland (1)
- # lsp (18)
- # malli (15)
- # off-topic (20)
- # overtone (1)
- # pathom (5)
- # pedestal (15)
- # portal (3)
- # reitit (13)
- # releases (1)
- # remote-jobs (1)
- # yamlscript (4)
Still a bb noob.
I'm trying to rewrite a bash script. One command is a long one-liner of commands piped together with various args.
What's the easiest way to convert something like that to valid bb?
And what's the most idiomatic/smartest? 😄
I tried just (shell "the-whole-thing")
, but that was invalid, I guess because it needs to be tokenized. But perhaps it's better to convert into pb
/`pipeline` usage?
https://github.com/babashka/process#piping-output & https://github.com/babashka/process#pipelines
So just use {:out :string}
for the last command, then deref
and :out
(-> (process smth)
(process smthelse)
(process {:out :string} athirdthing)
deref
:out)
Nice, got it working!
Thought about doing the conversion programatically, but some string literals in the bash one-liner contained pipes, so I quickly gave in and converted by hand 🙂
Any plans to support babashka pods (client) on ClojureDart ? Why do you ask ? Well, I have a couple of Clojure JVM dependencies that I would like to use in my Flutter app and I thought maybe a pod would be more convenient than something like JNI/JNA
There’s a couple of implementations of pod clients in other languages like python. Since this isn’t part of the bb binary anyone is free to implement and maintain that stuff for other languages. The protocol is documented. I can give you some guidance if you want
I found one here in common lisp: https://github.com/rorokimdim/stash/blob/bb4e4d6acac46be638cae757d2bee9d5c3c7d727/scripting-examples/common-lisp/stash.lisp
Is there a way to disable automatic decoding of URL-encoded characters in babashka.http-client
?
It looks like once query-params are used then this url
(http/get "" {:headers {} :query-params {:ref "xx"}})
is decoded to
But I still need
I am calling a site that doesn’t work with decoded URL chars.Thank you. Sometimes the workaround works, that you rewrite %2F to “%252F”, so you are left with %2F, but it doesn’t work here.
it seems the decoding only happens when you use :query-params
, so a workaround could be to add those query-params yourself
it seems the roundtrip for the uri decodes stuff:
(java.net.URI. (.getScheme uri) (.getAuthority uri)
(.getPath uri) new-query (.getFragment uri))