This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # ai (2)
- # announcements (5)
- # babashka (13)
- # beginners (24)
- # calva (22)
- # clerk (2)
- # clj-yaml (4)
- # cljsrn (1)
- # clojure (15)
- # clojure-dev (7)
- # data-science (5)
- # datalevin (1)
- # emacs (21)
- # events (1)
- # hyperfiddle (33)
- # lsp (71)
- # membrane (1)
- # podcasts (1)
- # practicalli (11)
- # re-frame (17)
- # reagent (2)
- # sci (1)
- # shadow-cljs (47)
- # transit (1)
Recommended listen if you want to know more about @rahul080327, the "behind the scenes" of babashka's development and the contents of the coming workshop at https://clojure.stream!
is there are way to play nicely with command line tools that modify the shell with source ? Unless I'm totally missing something, this doesn't seem to work for me. My specific use case is SDKMAN, which requires a
source "$HOME/.sdkman/bin/sdkman-init.sh" in your shell config to work. This, among many things, defines an sdk shell function for use on the command line. But when I try say
bb -e "(require '[babashka.process :refer [shell]]) (shell \"sdk help\")" I get an error saying "Cannot run program 'sdk'". This is despite the fact that I can run sdk help directly in the same shell no problem. I also am not able to do
bb -e "(require '[babashka.process :refer [shell]]) (shell \"source /path/to/.sdkman/src/sdkman-main.sh\")", instead receving an error "Cannot run program 'source'"
source is a built-in shell command, so you should do something like:
(shell (System/getenv "SHELL") "-c" "source" ...)
got, I'll try that!
oh okay, that makes sense - will definitely add that shell-calling pattern to my codebase somewhere I think I'll need it a lot. and calling
sdk works now, thanks!
Development question: How do I try out bb code from
lein repl? Is this the recommended way?
(babashka.main/main "-e" "(prn :foo)")
where babashka/dev is a local/root dependency with
:main-opts ["-m" "babashka.main"]