This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-01-30
Channels
- # announcements (3)
- # babashka (5)
- # beginners (68)
- # calva (34)
- # cider (6)
- # cljsrn (3)
- # clojure (48)
- # clojure-australia (2)
- # clojure-europe (1)
- # clojure-nl (4)
- # clojure-spec (28)
- # clojurescript (10)
- # conjure (20)
- # datahike (1)
- # deps-new (1)
- # depstar (27)
- # events (2)
- # fulcro (61)
- # graalvm (32)
- # membrane (18)
- # off-topic (20)
- # practicalli (10)
- # reagent (2)
- # shadow-cljs (8)
- # slack-help (20)
- # spacemacs (9)
- # sql (5)
- # vim (10)
- # xtdb (8)
Working on the babashka.fs lib. The hardest function is glob
and I would appreciate some of your testing.
(require '[babashka.deps :as deps])
(deps/add-deps '{:deps {babashka/fs
{:git/url ""
:sha "74d39a8e380480c558de547cd174435d63ca121d"}}})
(require '[babashka.fs :as fs])
(fs/glob "." "**.clj")
The rules of the glob patterns are explained in
https://docs.oracle.com/javase/7/docs/api/java/nio/file/FileSystem.html#getPathMatcher(java.lang.String)
Tl;dr: to cross dir boundaries use **
, e.g. **.clj
will match all .clj files in all dirs, *.clj
only matches .clj files in the current dir
Ran it through some tests and it seems to work fine. TIL that **
replaces any part of the path, not just a recursive set of directory names, e.g.`**ar/baz` finds foo/bar/baz
. Neat!
In 99eed8c041b590870d9aec6f4a717a46b0c65715
I now made some improvements. The returned paths will be relative to the input path, if the input path was also relative
Here are some work-in-progress docs: https://babashka.org/fs/babashka.fs.html