This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-02-22
Channels
- # announcements (88)
- # autochrome-github (2)
- # babashka (26)
- # beginners (5)
- # biff (2)
- # cider (73)
- # clj-kondo (4)
- # cljsrn (6)
- # clojure (54)
- # clojure-art (3)
- # clojure-europe (73)
- # clojure-germany (5)
- # clojure-new-zealand (1)
- # clojure-nl (13)
- # clojure-norway (16)
- # clojure-uk (8)
- # clojurescript (73)
- # conjure (1)
- # core-async (10)
- # cursive (17)
- # datahike (51)
- # datalevin (21)
- # datomic (4)
- # emacs (2)
- # events (3)
- # fulcro (35)
- # honeysql (6)
- # introduce-yourself (1)
- # jackdaw (3)
- # jobs (1)
- # leiningen (4)
- # lsp (3)
- # malli (17)
- # off-topic (60)
- # other-languages (5)
- # pathom (17)
- # pedestal (3)
- # polylith (19)
- # portal (2)
- # practicalli (1)
- # rdf (14)
- # reitit (3)
- # releases (1)
- # reveal (9)
- # sci (1)
- # shadow-cljs (26)
- # spacemacs (17)
- # sql (4)
- # testing (10)
- # tools-build (6)
- # tools-deps (16)
- # vim (9)
Is it possible to do an input redirection in shell with Babashka tasks?
I would like to make a script like:
mysql --login-path=mydb db < db_backup.sql
But I get an error when I use the "<" character. This did not work:
(shell {:out "out.txt" } "mysql -h localhost -u user -pPASSWD db < db_backup.sql")
Is there any other way to pass the contents of a file into a shell script?
hi! I'm getting a great kick out of learning Babashka. Has anyone managed to use it to access currency exchange rates via a web api?
@U04V15CAJ thank you - that is essentially my question yes!
I am trying babashka.curl
just now...
(require '[babashka.curl :as curl])
(require '[cheshire.core :as json]) (def resp (curl/get "" {:headers {\
"Accept" "application/json"}}))
(def body (json/parse-string (:body resp)))
(println (str "EUR:USD = " (get body "EUR_USD")))
The tools.tools project seems to work under the following conditions: • include babashka/spec.alpha • include the tools-deps-native pod (which brings in tools.deps.alpha via a pod)
$ bb -cp $(clojure -Spath -Sdeps '{:deps {org.babashka/spec.alpha {:git/url "" :sha "1a841c4cc1d4f6dab7505a98ed2d532dd9d56b78"}}}') -e "(babashka.pods/load-pod 'org.babashka/tools-deps-native \"0.0.5\")' "-e "(require '[clojure.tools.tools.api])"
But it requires further testing. So I'd say: it could work, but I'm not sure if it's worth pursuing.
I noticed when creating the Self contained bb executable with caxa that it takes ages to create and ages to start the executable for the first time. Is it perhaps related to the mac's M1 processor (lot's of issues seem to be related to it these days:)
@U96LS78UV Make sure that your directory doesn't contain any garbage and doesn't contain an executable you created before since it will package itself within the new executable. I.e. have the least amount of files in the directory so the binary will be the smallest possible.
It takes around 10s or so. Image is around 50mb. First time takes a while to invoke, but second time is way faster.