babashka

ericdallo 2025-08-01T16:31:59.529209Z

is there a way using fs/glob to match files case-insensitive?

✅ 1
ericdallo 2025-08-01T16:32:23.284959Z

AFAICS this is not supported in bb/fs, as would need to lowercase the glob + the path when matching?

borkdude 2025-08-01T16:53:29.002129Z

you can also use a regex with

ericdallo 2025-08-01T16:54:22.906049Z

hum, any examples?

ericdallo 2025-08-01T16:54:43.953859Z

I'm using that on http://github.com/editor-code-assistant/eca to list the files user can use as context

ericdallo 2025-08-01T16:55:14.404319Z

so if one type foo it will search all files in the project which match that, so not sure regex is better than glob search

ericdallo 2025-08-01T16:55:33.351299Z

because I wanna search across multiple dir levels too seeking for foo in the filename or dir name

borkdude 2025-08-01T17:10:08.984819Z

you can use fs/match with "regex:..."

borkdude 2025-08-01T17:12:42.650929Z

user=> (fs/match "." "regex:.*/[cC]lj_kondo/.*core.clj" {:recursive true})
[#object[sun.nio.fs.UnixPath 0x2dfe9986 "parser/clj_kondo/impl/rewrite_clj/parser/core.clj"] #object[sun.nio.fs.UnixPath 0x93d07b3 "src/clj_kondo/impl/types/clojure/core.clj"] #object[sun.nio.fs.UnixPath 0x2e73b951 "src/clj_kondo/impl/core.clj"] #object[sun.nio.fs.UnixPath 0x3e1d673d "src/clj_kondo/core.clj"]]

ericdallo 2025-08-01T17:14:59.706059Z

humm amazing! looks like it works for me, will test, thanks!