Fork me on GitHub
#babashka
<
2024-05-30
>
borkdude13:05:59

Babashka on master now can run https://github.com/cognitect-labs/transcriptor/blob/master/transcriptor.clj, a REPL-based testing library, thanks to @highpressurecarsalesm! Bob has been making great contributions to babashka so thanks a lot!

👍 2
Noah Bogart15:05:42

I'm interested in using https://github.com/clj-commons/pomegranate/ in babashka. it relies on a lot of interop, mostly focused in org.eclipse.aether. To double check, that's just a no-go, right?

✅ 1
borkdude15:05:59

correct. perhaps this is an a x-y problem though, what do you want to do with pomegranate in bb?

Noah Bogart15:05:29

i'm looking to use slipset's deps-deploy to deploy to clojars from babashka

borkdude15:05:32

did you already find clojure.tools.bbuild? (yes with double b)

👍 1
Noah Bogart15:05:41

i'm building a lein-like cli tool that automates some common tasks i have in my projects as all of my build.clj's look exactly the same (minus the :lib differences lol), and with tools.bbuild i'm able automate compilation/jar/uberjar building

borkdude15:05:57

just a side question: why does deps-deploy use pomegranate

Noah Bogart15:05:03

i'd like to implement deploying as well, and deps-deploy is the easiest method for it that i've found (all other libraries seem to rely on it (liquidz/build.edn, depstar, etc)

Noah Bogart15:05:16

deps-deploy is a thin wrapper over pomegrante:

(defmethod deploy* :local [{:keys [artifact-map coordinates]}]
  (println "Installing" (artifact coordinates) "to your local `.m2`")
  (aether/install :artifact-map artifact-map
                  :transfer-listener :stdout
                  :coordinates (mvn-coordinates coordinates))
  (println "done."))
where aether is cemerick.pomegranate.aether

borkdude15:05:53

perhaps in this case it's better to just call out to JVM Clojure (you can construct clojure CLI calls with (babashka.clojure "-Sdeps" etc) then.

👍 1
borkdude15:05:04

for the deploy part

borkdude15:05:15

or for everything else too, not sure :)

Noah Bogart15:05:17

ah yeah, that could work

Noah Bogart15:05:46

thanks, i'll give that a try

Brandon Olivier16:05:49

Is there a mechanism in babashka.process that would allow me to wait and add input after some amount of time (preferably determined by the command itself)? My use case is that a lot of folks I know write “scripts” that are interactive via a JS library called prompts and I need to run it a lot of times with predetermined input, so I figured scripting babashka to do it for me was a good option.

borkdude16:05:59

Nothing built in for this but you can wait yourself and then write

Brandon Olivier16:05:02

I kinda figured, just wanted to check 😉 Would I just loop/wait and check :out?

borkdude16:05:11

You didn’t specify this but do you want to write after waiting for some time or after some output appeared?

Brandon Olivier16:05:41

I need to write after some output appears. For some reason, we have a bunch of scripts that don’t take inputs via the CLI and are interactive only

borkdude16:05:16

Yeah, then you read line by line from out and then write to in