krzjoa / path.chain

Concise structure for path chaining
https://krzjoa.github.io/path.chain/
Other
9 stars 1 forks source link

Recursion Depth #1

Open WurmPeter opened 2 months ago

WurmPeter commented 2 months ago

Hello,

You wrote a nice package, thanks. I would use it to compose paths.

Having directories with thousands of subdirectories and files, the generated config file gets far too big. Is there a way to only store the structure x levels deep? And/or without files?

krzjoa commented 2 months ago

Hi @Nefcairon,

At the moment there isn't, but I can see the path_chain function can be easily adopted to include this feature.

Please add a PR, which changes this fragment of code. You should replace list.files with a function, which allows to specify the maximum recursion depth. I think the dirdf package with its dir2 function should be a good solution. You could only copy-paste that function with adding a relevant comment.

WurmPeter commented 2 months ago

Thanks, I'll give it a try.