Fork me on GitHub

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 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!

👍 8

In 99eed8c041b590870d9aec6f4a717a46b0c65715 I now made some improvements. The returned paths will be relative to the input path, if the input path was also relative