This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-01-19
Channels
- # announcements (19)
- # asami (9)
- # babashka (26)
- # beginners (87)
- # biff (23)
- # calva (6)
- # clerk (7)
- # clj-kondo (3)
- # cljsrn (3)
- # clojure (115)
- # clojure-belgium (1)
- # clojure-berlin (1)
- # clojure-europe (31)
- # clojure-gamedev (5)
- # clojure-nl (2)
- # clojure-norway (8)
- # clojure-uk (2)
- # clojurescript (43)
- # clr (23)
- # datalevin (1)
- # datomic (14)
- # dev-tooling (23)
- # fulcro (38)
- # graphql (1)
- # gratitude (1)
- # jobs (1)
- # lsp (30)
- # off-topic (7)
- # pathom (25)
- # portal (21)
- # quil (6)
- # releases (5)
- # remote-jobs (1)
- # shadow-cljs (34)
- # sql (5)
- # tools-deps (6)
- # xtdb (13)
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!
Very cool! Do you want to share this link with the broader community in #C8NUSGWG6 ?
Thank you! And for the tweet!
@U04KF24EX3M this was directly inspired by your post: https://github.com/lispyclouds/bblgum hopefully smoothens your process even more!
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!
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.Attributes
◦ java.util.concurrent.ThreadFactory
◦ java.lang.Thread$UncaughtExceptionHandler
◦ java.lang.Thread$UncaughtExceptionHandler
◦ java.util.concurrent.BlockingQueue
◦ java.util.concurrent.ArrayBlockingQueue
◦ java.util.concurrent.ThreadFactory
◦ java.lang.Thread$UncaughtExceptionHandler
◦ java.util.concurrent.Semaphore
• Expose more httpkit.server functions: with-channel
, on-close
, close
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 😕thats pretty much what id do as well, just make a helper fn called exec
or something for it
the new lines is dependent on the program youre running, need to trim it externally
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
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
: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
😅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
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
from what I understand it can work to install from file in git:
guix install -f <(curl someurl)
Nice! Guix system or in foreign distro? Check out #C02RZ91K0H1 as well :)