Fork me on GitHub
#babashka
<
2023-01-19
>
snipersdream02:01:59

Heyo, I wrote my first blog post! It's about adding a little bit of TUI to your Babashka scripts with gum https://rattlin.blog/bbgum.html Also, thanks for making quickblog!

🎉 12
💯 10
4
borkdude08:01:22

Very cool! Do you want to share this link with the broader community in #C8NUSGWG6 ?

borkdude09:01:22

Already shared it there :)

snipersdream00:01:07

Thank you! And for the tweet!

lispyclouds21:01:55

@U04KF24EX3M this was directly inspired by your post: https://github.com/lispyclouds/bblgum hopefully smoothens your process even more!

🙌 2
snipersdream00:01:45

This is awesome! I learned a lot by reading through the code, even for how small it is. I'll add an update to the post!

❤️ 2
borkdude11:01:28

New babashka release: 1.0.170 (2023-01-19) • https://github.com/babashka/babashka/issues/1463: Add java.util.jar.Attributes class (https://github.com/jeroenvandijk) • https://github.com/babashka/babashka/issues/1456: allow *warn-on-reflection* and *unchecked-math* to be set in socket REPL and nREPL (https://github.com/axks) • SCI: macroexpansion error location improvement • Add compatibility with https://github.com/eerohele/tab and https://github.com/adam-james-v/solenoid • Bump babashka.cli and babashka.fs • New classes: ◦ java.util.jar.Attributesjava.util.concurrent.ThreadFactoryjava.lang.Thread$UncaughtExceptionHandlerjava.lang.Thread$UncaughtExceptionHandlerjava.util.concurrent.BlockingQueuejava.util.concurrent.ArrayBlockingQueuejava.util.concurrent.ThreadFactoryjava.lang.Thread$UncaughtExceptionHandlerjava.util.concurrent.Semaphore • Expose more httpkit.server functions: with-channel, on-close, close

babashka 24
🚀 4
🎉 6
😉 2
gratitude-thank-you 2
Casey13:01:46

I'm writing a little deploy script in bb.. is there a cleaner way to repeatedly run a command and get the output without new lines?

hash (str/trim (:out (sh "git rev-parse --short HEAD")))
branch (str/trim (:out (sh "git rev-parse --abbrev-ref HEAD")))
I have a bunch of lines like this 😕

lispyclouds13:01:41

thats pretty much what id do as well, just make a helper fn called exec or something for it

lispyclouds13:01:37

the new lines is dependent on the program youre running, need to trim it externally

👍 4
staypufd22:01:02

You might try the --sq option flag. It says: > Usually the output is made one line per flag and parameter. This option makes output a single line, properly quoted for consumption by shell. Useful when you expect your parameter to contain whitespaces and newlines (e.g. when using pickaxe -S with git diff-*). In contrast to the --sq-quote option, the command input is still interpreted as usual. Found it here: https://git-scm.com/docs/git-rev-parse You also might be able to combine that with --short flag

vlad_poh16:01:26

Anyway to add deps without Java?

borkdude16:01:13

What kind of deps

borkdude17:01:59

I'm asking because it depends :)

2
vlad_poh23:01:02

load-pod worked but add-deps threw a Java not found error

borkdude07:01:53

Please give me an example of some deps you’re adding

borkdude10:01:40

I made an example here how you can add deps without Java: https://github.com/babashka/babashka/wiki/Adding-dependencies-without-Java-using-tools-deps-native Note that this is considered experimental

💯 2
borkdude11:01:54

It is recommended to just install Java though

Benjamin17:01:34

:thinking_face: use powershell or .bat for a windows gitlab job. "I might learn some windows and my windows team mates will be able to read the script" 10min later

- powershell -Command "if (Test-Path('bb.exe')) { return } else { (New-Object Net.WebClient).DownloadFile('', 'bb.zip') }"
    - powershell -Command "if (Test-Path('bb.exe')) { return } else { Expand-Archive bb.zip . }"
    - ./bb.exe script/gen-unitypackage/activate-unity.clj
😅

babashka 18
404 2
Benjamin20:01:08

when tasks are pulled in via deps.edn what is good way to look at the source code?

borkdude20:01:29

tasks are never pulled in via deps.edn - only library code that is exposed via deps.edn is, bb.edn is always project-local and is never used for exposing library code

Eugen23:01:48

hi, FYI I am exploring guix and my first package is babashka - statically linked 🙂

8
Eugen23:01:39

babashka.scm:

(use-modules (guix packages)
             (guix download)
             (guix build-system copy)
             (guix licenses))

(package
   (name "babashka")
   (version "1.0.170")
   (source (origin
            (method url-fetch)
            (uri (string-append ""
                                version "/babashka-" version "-linux-amd64-static.tar.gz" ))
            (sha256
             (base32 "199czv6j3ibz8v5c6pcf2qksamwvb1abm89gwqpvb9ym6nxl1wns"))))
   (build-system copy-build-system)
   (arguments
       `(#:install-plan '(("bb" "bin/"))))
   (synopsis "Native, fast starting Clojure interpreter for scripting")
   (description "Babashka is a native Clojure interpreter for scripting with fast startup. Its main goal is to leverage Clojure in places where you would be using bash otherwise.")
   (home-page "")
   (license epl1.0))
build and install with
guix package --install-from-file=babashka.scm

Eugen23:01:59

from what I understand it can work to install from file in git:

guix install -f <(curl someurl)

pavlosmelissinos07:01:02

Nice! Guix system or in foreign distro? Check out #C02RZ91K0H1 as well :)

Eugen14:01:53

foreign distro (Debian). thanks. Should work on guix since its statically linked