Fork me on GitHub

@borkdude Just checking how 0.5.1 is looking. On Wednesday I’m going away hiking for the rest of the week, and I have the Cursive bit in a state where I could release a beta build. Since it’ll require 0.5.1 for the deps output part, I’ll wait till that’s out before releasing. No pressure though, otherwise I can release when I’m back, no problem.


I can get 0.5.1 out with the deps output by then, no problem. But I was also planning to look into the vars without metadata and the dynamic vars. Not sure I can get those in before Wednesday. Do you prefer an earlier release without those?


Hmm, good question, I’d forgotten about that. The dynamic vars aren’t a problem since I’ve implemented the REPL over nREPL for now, and I can support the socket REPL later. The missing vars will only affect completion, currently I have a hack which uses clojure.core if the ns is missing, but I haven’t gone back to check if I can default that in a better way. I’ll look at that tomorrow and let you know.


Actually, I just checked - I can default that, no problem. So no, I don’t need either of those.


ok, there are two things for me to do: write a test for the print-deps and upgrade deps.clj to the newest clojure CLI stuff and then I can release a new bb for you

👍 2

Upgraded deps.clj, binary coming up.


I posted in the main channel. The last thing I'll have to do is write test for print-deps but I suspect there will be no other changes for 0.5.1.


Just wrote a test and found one little thing, but probably not important for you.


Just in case, here's the final binary: Tomorrow morning I'll release 0.5.1 (in 10 hours from now or so)


Great, thanks! I’ll test out with the final version today.


@ericdallo @cfleming Released 0.5.1 now

🎉 3

I’d like to use a glob in fs/modifield-sinceit would require another branch here: Is this worth a PR?


@donavan you can use it like this: (fs/modified-since ... (fs/glob ...))


In the anchor?


should also work I think


Don’t think so, it would mean at that line above you have a vector of file paths


…which ends up being passed to fs/file


ah ok, so the anchor is expected to be one target file


representing a file or directory, yeah


I guess for now you could use (mapcat #(fs/modified-since % ...) your-files) ?


but yeah, it would be nice if you could put a glob there


Shall I take a stab at PR?


I'd have to think if this would still be the correct semantics, but since you can put a dir there too, I think it would


ok, please add tests :)


will do 👍


I will publish a new bb tomorrow to support new efforts in #cursive and LSP to get better babashka script support (resolving of vars for static analysis + nREPL). I upgraded deps.clj to match the newest clojure CLI (so bb clojure should work with the new tools stuff as well). Please give it a spin. Linux: macOS: Windows: (build still going: /cc @cfleming @ericdallo

🔥 4

@ericdallo Please wait publishing clojure-lsp until I also get the clj-kondo issue sorted, if you can :)

👍 2

This may be a bit out there,,, but has anyone an example of using babashka to convert a series of clojure hash maps into individual curl scripts ? I want to populate a dynamodb database via an API I have for staging and production environments, which I'm supposed to use a script (although will anyone know if I switch on an nREPL server...)


How general are your maps? You may be able to use selmer to convert them into the text you want. The difficulty of that approach is correlated with how many curl features or flags you want to use


an example of one of those maps would help us understand your problem


Its a completely flat map with keywords and mostly strings as values {:account-id "" :account-name "" :status true ,,,} and about 6 other key values pairs the same


@jr0cket do you mean, you would like to insert this as JSON with a POST request and you would like the curl command line format for this?


Suppose I’ve written a babashka script with a couple of external project dependencies; what’s the best way of packaging that up into something a not-super-technical person without babashka installed could easily download and run?


I was thinking applying uberscript and might be the solution, but nativity doesn’t seem to work for me at all when playing with it locally


@aengelberg actually, the upcoming 0.5.1 version has a new CLI option calls print-deps which prints a deps.edn map with all built-in deps + external deps

nice 2

you could then use that for making a native CLI. I've illustrated here how you could do that, once you have a deps.edn:


it would be cool if you could test that new functionality


else wait until tomorrow


I can provide you a pre-release binary, just let me know


but to be honest, just letting the other person install babashka is maybe easier since you won't have to deal with all your consumer's OSes, etc.


you could package up the script + deps into an uberjar and let that person run that


I can have a hack around with something in the morning... I am exhausted now.. its been a long 12+ at work 😞


bb uberjar does that


btw thanks for all the work on babashka, just started using it recently and really enjoying it!

❤️ 2

I’m not really sure how binaries work, but do you think it’s possible (for each OS) to combine the existing bb binary and a script into a single binary that just feeds the script to bb?


without really knowing the internals, it feels like that should be technically feasible without having to re-run GraalVM


this feature has been requested more often, but this is similar to packaging up a complete nodejs or python + scripts. Usually it's easier to just install node on the other side and them let them use the script


Perhaps it is possible to package some extra resources into a binary, but I don't know how

👍 2

running a bb uberjar requires JVM installed, right?


only when you download / compute the classpath it uses a JVM


but once you have created the uberjar, no JVM needed

👍 2

also not for creating the uberjar itself when you already have the classpath


To be sure I asked the binary + resources question in the GraalVM slack (