This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-01-28
Channels
- # announcements (4)
- # aws (2)
- # babashka (56)
- # beginners (43)
- # calva (70)
- # clj-kondo (25)
- # cljs-dev (29)
- # clojure (103)
- # clojure-dev (9)
- # clojure-europe (55)
- # clojure-gamedev (8)
- # clojure-nl (5)
- # clojure-norway (5)
- # clojure-uk (4)
- # clojured (1)
- # clojurescript (56)
- # copenhagen-clojurians (1)
- # core-async (2)
- # cursive (16)
- # datomic (5)
- # deps-new (18)
- # emacs (9)
- # events (3)
- # fulcro (45)
- # graphql (2)
- # gratitude (2)
- # kaocha (6)
- # lambdaisland (8)
- # lsp (72)
- # meander (41)
- # missionary (5)
- # nextjournal (52)
- # off-topic (2)
- # pathom (12)
- # pedestal (2)
- # practicalli (1)
- # re-frame (6)
- # reitit (5)
- # releases (1)
- # reveal (1)
- # specter (3)
- # sql (4)
- # tools-deps (22)
- # vim (8)
- # wasm (1)
- # xtdb (22)
hello, i have a tmux session called test, i want to use babashka to attach the session
(shell/sh "tmux" "attach-session" "-t" "test")
it shows the error
{:exit 1, :out "", :err "open terminal failed: not a terminal\n"}
how can i do?(-> (process ["tmux" "attach-session" "-t" "test"] {:inherit true}) check)
maybe should use like this, thanks@U9ABG0ERZ It doesn't. Why do you need this?
I have a task that have the deps for run it, but I want to have an easier way to run a repl without running the execution on task itself
It would be good to have the deps only for a certain path that I load
that runs 1 script
I have 2 tasks primarly
for the repl you could make a script repl.clj
and put (babashka.deps/add-deps '{:deps ...})
in it, and load that in the REPL
A & B A should not load the deps that B needs
something like this
having more dependencies on the bb classpath doesn't affect performance, unless you really load those namespaces
yeah, should be better to load it from deps.edn
Does anyone know of a way to pull a dependency from an s3 repository for babashka? We use the s3-wagon-private leiningen plugin to deploy the library. The url looks something like this
I’m trying to use fs/create-file, but I only seem to be able to get it to work when it’s a file from within my project folder. Is it possible to create files in directories outside of my project folder?
Sure, you just need to provide an absolute path and create parent directories with fs/create-dirs
So something like
(doto (fs/file "/tmp/foo/bar/baz") (-> fs/parent fs/create-dirs) fs/create-file)
I’m confused… why do I need to create new parent directories?
if you are writing a file /tmp/foo/bar/baz
but the parent directories do not exist, then you need to create them first. if they already exist, then it should just work without creating those.
Yeah they should already exist… but when I run these functions it returns false. Would this be a system permissions thing for my code editor?
I get the confusion. ~
isn't expanded, but there is an expand-home
function for this
Ah I see… Got it. Still have an issue though - I’ve got the recent version of fs in my project dependencies, but now when I try to run that function, it says No such var: fs/expand-home
(fs/expand-home "~/Dropbox/Notes/Test/")
can you paste a complete project.clj here? then I can try it locally? you can remove almost anything but the :dependencies
(defproject functions-for-processing-notes "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
:url " "}
:dependencies [[org.clojure/clojure "1.10.3"]
[dk.ative/docjure "1.14.0"]
[com.rpl/specter "1.1.3"]
[babashka/fs "0.1.2"]
[orchestra "2021.01.01-1"]
[lambdaisland/deep-diff2 "2.0.108"]
[org.clojars.arthurbarroso/lovelace "0.1.2"]]
:repl-options {:init-ns functions-for-processing-notes.core})
functions-for-processing-notes.core=> (require '[babashka.fs :as fs])
nil
functions-for-processing-notes.core=> (fs/expand-home "~/Dropbox/foo")
#object[sun.nio.fs.UnixPath 0x628c30e8 "/Users/borkdude/Dropbox/foo"]
Weird… these are the only options that show up for me on autocomplete too
Yes, I’m using babashka.fs on the JVM in Calva
No worries! I appreciate the help you’re giving me
[babashka/fs "0.1.2"]
is that not the newest version?
It’s not just that the tooling isn’t showing the function… when I try to eval, it says No such var: fs/expand-home
don't paste the entire output here, but only the part that is concerning babashka.fs
jar:/Users/roberthaisfield/.m2/repository/babashka/fs/0.0.5/fs-0.0.5.
Hmm why would it have that if my dependencies has the correct version?