For ii, I’m using glam to provide repeatable tool versions for makejack, Makejack invokes tools directly without using.a shell, The new glam.edn
file can be used to fix the version of the tool. Currently it uses the install
command and parses the output path string to get the tool’s path.
Ideally makejack would be able to install tools whether or not glam has been explicitly installed by the user. It currently use clojure to install a babashka version, then uses babashka to run glam.
$
is a convenience macro around process
:
(def config {:output {:format :edn}})
(-> ($ clj-kondo --config ~config --lint "src") :out slurp edn/read-string)
{:findings [], :summary {:error 0, :warning 0, :info 0, :type :summary, :duration 34}}
Just pushed the above to master. Please try it out. Binaries are in #babashka_circleci_builds
Hi, i wanted to use http-kit in babashka.
So i imported [org.httpkit.client :as client]
but now i am recieving … #object[org.httpkit.client$deadlock_guard$reify__14437 0x202e5d90 {:status :pending, :val nil}] #object[org.httpkit.client$deadlock_guard$reify__14437 0x5e587c9f {:status :pending, :val nil}] #object[org.httpkit.client$deadlock_guard$reify__14437 0x9c51ba6 {:status :pending, :val nil}] #object[org.httpkit.client$deadlock_guard$reify__14437 0x98a5229 {:status :pending, :val nil}] #object[org.httpkit.client$deadlock_guard$reify__14437 0x617e2f53 {:status :pending, :val nil}]))
…
for every post request on my localhost:3000/api/…
thanks
are you deref'ing the request?
http-kit requests are async, thus you need to @
them
@jakub.zika-extern Yes, check out http://http-kit.github.io/
I forget to add that using clj-http-kit
works fine.
@jakub.zika-extern You can also use babashka.curl
which is more like clj-http, and shells out to curl
@borkdude i would like to have this code usable in my clj+cljs webapp and in standalone mode like client and i did not find babashka.curl as a lein dependency
@jakub.zika-extern I would be happy to make a lein release for babashka.curl. But you can also use .cljc
with a :bb
reader conditional. But httpkit also just works fine. Just put an @ like @(org.httpkit.client/get ...)
Ok, Thanks. I will try it (and try to find something about a diference between requesting [http-kit] and [org.http-kit.client])
Works like a charm, thanks @borkdude and @ddouglass
Hi, another question 🙂 I see that I can use java.time for various time function but I can not access java.text. My use case.- I have a string in DDMMYYYYHHMMSS pattern that i would like to get into java.time easily and then parse it back into DD-MM-YYYY HH:MM:SS string. How would you do this in BB?
@jakub.zika-extern Can you give an example using java.text
?
import java.text.DateFormat;
import java.util.Date;
import java.text.SimpleDateFormat;
public class Demo {
public static void main(String[] args) throws Exception {
String strTime = "20:15:40";
DateFormat dateFormat = new SimpleDateFormat("hh:mm:ss");
Date d = dateFormat.parse(strTime);
System.out.println("Resultant Date and Time = " + d);
}
}
I'm pretty sure you can do that using java.time
I do not see any function to load/parse a string in its api
(def fmt (java.time.format.DateTimeFormatter/ofPattern "ddMMyyyy"))
(java.time.LocalDate/parse "01022000" fmt)
https://docs.oracle.com/javase/tutorial/datetime/iso/format.htmlFirst signs of babashka/process usage! https://github.com/borkdude/babashka/issues/575#issuecomment-712460781