This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-03-13
Channels
- # announcements (12)
- # babashka (42)
- # beginners (45)
- # calva (60)
- # cider (6)
- # circleci (1)
- # clj-kondo (18)
- # clojure (21)
- # clojurescript (36)
- # conjure (13)
- # cursive (2)
- # datahike (5)
- # datomic (4)
- # depstar (17)
- # emacs (4)
- # fulcro (3)
- # honeysql (2)
- # jobs (2)
- # jobs-discuss (9)
- # lsp (98)
- # malli (32)
- # off-topic (36)
- # other-languages (2)
- # overtone (4)
- # re-frame (5)
- # reveal (7)
- # rewrite-clj (47)
- # shadow-cljs (25)
- # spacemacs (4)
- # vim (7)
--nrepl-server Start nREPL server. Specify port (e.g. 1667) or host and port separated by colon (e.g. 127.0.0.1:1667).
Can anyone point me to a minimal example on how to use babashka as org-babel clojure backend for .org code blocks in emacs? (or is this a bad idea)?
I decided to rewrite one of the bash scripts in babashka. The problem: it reads environment variables from a .env
file in CWD.
I came up with this:
#!/usr/bin/env bash
":" ; set -a
":" ; . .env
":" ; set +a
":" ; exec bb "$0" "$@"
":" ; exit
(require '[babashka.process :as p]
'[clojure.string :as str])
;; The script continues.
Is it reasonable? Is there a better way?@p-himik This is how you can do it with bb, launching itself another time:
(require '[babashka.process :as p])
(when-not (System/getenv "continue_script")
(-> (p/process ['bb *file*] {:inherit true
:env (assoc (into {} (System/getenv))
"SOME_COOL_ENV_VAR" "123"
"continue_script" "true")})
p/check)
(System/exit 0))
(println (System/getenv "SOME_COOL_ENV_VAR")) ;; 123
Right, but the issue is that that .env
file is used by many other things - I can't just remove it. Maybe if I rewrite everything shell-related, but I'd like to postpone that. :)
Harder than I'd like. :) Comments, escape sequences, quotes, variable expansions. It's not a fixed format, alas.
It might not? Not sure. Just got a failure for one of my scripts on Windows, thought it might just be my usage of fs/glob
but just tried a clojure -M:test
for babashka/fs
on a Windows 10 virtual machine and see some failures.
Can you be more specific? I currently don't have Windows-specific tests for this lib, but that sounds like a good idea
Well… there are more than a few failures…
Ran 32 tests containing 82 assertions.
9 failures, 8 errors.
Can reproduce on Windows. A couple of those errors are coming from posix file permission checks, which are not available on Windows, so that is kind of expected
Yeah, help is surely appreciated. I think we can add an appveyor config like the other projects (I think babashka.curl has one that might fit for this project well)
the spec of that glob syntax is here: True that it is different for Windows: https://docs.oracle.com/javase/7/docs/api/java/nio/file/FileSystem.html#getPathMatcher(java.lang.String) Let's take it to the babashka-sci-dev channel, I'll invite you there