Fork me on GitHub
#babashka
<
2020-06-07
>
Ian Fernandez04:06:56

anyone having problems with clj-http lite?

Ian Fernandez04:06:14

I couldn't require the client ns

Ian Fernandez04:06:19

using babashka

Crispin05:06:49

@d.ian.b try setting your classpath

borkdude12:06:52

Invoke vim in the middle of a script, discovered by @marques.goncalves.fel :

#!/usr/bin/env bb

(require '[ :as io])

(defn vim [file]
  (->
   (ProcessBuilder. ["vim" file])
   (.inheritIO)
   (.start)
   (.waitFor)))

(def readme
  (let [f (io/file "README.md")]
    (when (not (.exists f))
      (vim (.getPath f)))
    (slurp f)))

(println readme)

agilecreativity17:06:54

I am publishing my very first Babashka pod that uses multigrep library. https://github.com/agilecreativity/pod-b12n-mgrep

David Pham18:06:42

Just my two 2 cents for improvement for babashka. This is only a personal feedback, so I hope you do not take it personally, it is probably only me. One of my biggest issue is about adding library to Babashka. I know there is documentation, but somehow, it does not feel easy (as you have to export the classpath as a string and everything, and it might be harder to make transportable). For example, I wanted to use clj-http-lite and I find it convoluted. Is there a way babashka could leverage on deps.edn for building the cp?

borkdude19:06:50

@neo2551 Btw, any reason you're using clj-http-lite and not the built-in babashka.curl? Maybe besides the point of using libs as a general question

David Pham19:06:00

I tried it at work, and I just wanted to make a post request with some arguments and somehow with a similar code clj-http-lite managed to return me the correct response while babashka.curl could not.

David Pham19:06:21

It was about content length from the header request

David Pham19:06:41

I was a bit in a rush, so I did not took the time to perfectly found the cause, sorry.

borkdude19:06:42

please report any issues with babashka.curl at https://github.com/borkdude/babashka.curl

David Pham19:06:05

I would need to find the exact cause, otherwise I don't want to waste your time!

borkdude19:06:25

sure 🙂 so tl;dr: deps.clj is the answer I have to your question currently

David Pham19:06:31

I will try that 🙂 Thanks a lot

David Pham19:06:36

Does deps start faster than clojure?

borkdude19:06:25

similar. there are two flavors: one that runs as a babashka script and natively compiled binaries for linux, mac and windows.

borkdude19:06:45

the bb script runs a few ms slower than the bash equivalent, the binary might be slightly faster