Fork me on GitHub

For, if I use it in a normal clj (not bb) project. When I run clojure -Sdeps will it invoke a subprocess or running inside the current process? Also, why the package name is borkdude.deps and not babashka.deps?


Sounds like the lib is not meant to be used as a library, but instead as a standalone process.


This project is exactly what it says what it is: the clj bash script rewritten in Clojure. The bash script invokes a Java process to calculate the classpath. But it also caches the classpath, so the second time it won't.


It's “borkdude” because everything including babashka started under borkdude. Some repos were moved and some weren't.


This project started as a babashka script but later on it turned out to be useful within bb itself

Søren Sjørup08:07:45

To get scittle.nrepl to work with ClojureJVM I had to add nrepl/bencode {:mvn/version "1.1.0"} to my deps.edn . Am I doing something wrong?


I think you're correct. I only tested this by running the server in bb, which also works but there nrepl/bencode is included


💯 1
🎉 2
Darrick Wiebe16:07:31

Nice. Just 2 days ago I borrowed your blog back end to start my own. Much better this way than being on a fork! BTW, I just noticed that in the generated .xml files, you've hard coded your own name as author! 🙂 git:(master) grep -r Michiel
./public/planetclojure.xml:    <name>Michiel Borkent</name>
./public/atom.xml:    <name>Michiel Borkent</name>

👍 1

@U01D37REZHP We should make this configurable. PRs welcome!

👍 1

Quick quickblog question. How are you injecting

watch-script "<script type=\"text/javascript\" src=\"\"></script>"
( into the rendered HTML? I'm loosing track of where watch-script is being used. Does the render differently depending on whether it's being used to produce live-reloading local output or final HTML render?


@U3X7174KS It's injected here during the function watch


Aaaah, so the HTML template can optionally receive the watch script. Nice, thanks!


Writing an EDN filter with bb is super easy:

echo '{:args [1 2]}' | bb '(assoc *input* :sum (reduce + (:args *input*)))'
{:args [1 2], :sum 3}
Is the best way to write a JSON filter with bb with jet?
echo '{"args": [1, 2]}' | jet --from json | bb '(assoc *input* :sum (reduce + (:args *input*)))' | jet --to json


I was kind of curious if there was some kind of --json flag for babashka to use JSON for IO instead of EDN -


you could combine jet and bb for this :)


or just write a script and place it on your path


but jet can also execute functions

👀 1

$ echo '{"args": [1, 2]}' | jet --from json --keywordize --to json -T '(as-> $ (assoc $ :sum (reduce + (:args $))))'
  "args" : [ 1, 2 ],
  "sum" : 3

👀 1

ohh, nice. Jet is executing functions with sci, I assume?


A cleaner solution:

$ echo '{"args": [1, 2]}' | jet -i json -o json -k -f '#(assoc % :sum (reduce + (:args %)))'
Yes, also SCI

👍 1
Jeffrey Bay16:07:15

babashka.fs/glob does not find files which are symlinks

Jeffrey Bay16:07:14

the symlink is a named file in the unix abstraction, it is weird to me that if the glob name filter matches, that glob wouldn't include the symlink path in its results, and leave the user to decide what to do with the link.


might be a bug, can you file a repro in the fs repo?

Jeffrey Bay16:07:20

I tried using :follow-links true as well, but from inspecting the source and the behavior, that is about following a link to continuing recursing below a linked directory

Jeffrey Bay16:07:06

hmm - i'm not sure how to repro

Jeffrey Bay16:07:32

it's clearly happening in my non-trivial case, but when i try to create a trivial case, it works fine


maybe when the symbolic link links to a dir outside of the dir?

Jeffrey Bay16:07:27

i tried that - that works too


you could try to check out the fs lib locally and add some logging to it, etc

Jeffrey Bay16:07:59

it's a deeper tree, but that's the only difference

Jeffrey Bay16:07:11

(that i can see)

Jeffrey Bay16:07:15

ls shows the file with the same pattern glob does - it isn't even a recursive pattern, it looks like this:

Jeffrey Bay16:07:29

ls */foo/bar/baz*.clj

Jeffrey Bay16:07:38

(linking config files instead of having them in situ, and the glob pattern isn't finding the ones that are linked. it's baffling given that the repro is working fine)

Jeffrey Bay17:07:13

well, instrumenting the fs library helped, thanks for the suggestion. it was actually one layer up, the conversion from a unixpath result to a (through an extra call to .getCanonicalPath, natch) was replacing the path with the symlink target path. unexpected, but not babashka.fs's fault 😆 this is why you always ask for a repro


so, all good?

Jeffrey Bay19:07:45

thanks for the suggestions on debugging


Want to transform Markdown, Org-mode, Asciitext, HTML or even EPUB wth Clojure? It turns out that Babashka and clojure.walk is an excellent choice for writing Pandoc filters. Here's a writeup:

🆒 5

Cool stuff :) Also post to #news-and-articles? I think we should also revive: But surely you can already add it here too:

👍 1

You could simplify the bash wrapper by doing the JSON reading in bb itself, using cheshire


Added the links to those pages now

👍 1

I forgot to update the page in the babashka repo, but I'm picking back up now. If anyone wants to help backfill news items from previous months, check out the #babashka hashtag on Twitter: I usually share all new projects and tidbits there (among other noise I make about my own work in progress stuff, sorry) PRs welcome


Now backfilled January 2022: Will post other months in thread to this message.

🔥 3