Open slifin opened 4 years ago
Hey that shouldn't be hard. I thought about indexing other(non source) files you might be interested in but never added that functionality.
Let me think a little about the api and I'll try it on a branch.
@slifin take a look and try the generic-file-indexing
branch.
Added a section in the readme on how to use the new functionality. https://github.com/jpmonettas/clindex/blob/generic-file-indexing/README.md#using-clindex-for-indexing-othe-project-files-experimental
I'll experiment and test the api and implementation some more before merging it into master.
Let me know if it work for your use case since I currently don't have a real one.
You just provide a predicate :index-file?
to say you are interested in indexing that file and then provide :file-facts
which will be called for every file that matches the predicate so you can provide the datoms for that file.
When the file changes clindex will automatically retract all the facts for that file and call your :file-facts
function again.
Be aware that it works for the entire project tree not only your base folder.
ah nice thank you, I've only just seen this, will try it out @jpmonettas
What would be involved in including edn files during the scan? I'm interested in scanning configuration files but I also want my scan to pick up changes the same way that clindex gets notifications from
hawk/watch!
so I'd rather try and extend clindex rather than implement something outside it