Exclude files during library install

Is there a way to exclude files during the library install process? Reason for asking is that our library, which I am busy testing, locally from my hard disk, is stored in Github and so the library install process ends up copying all of the megabytes of stuff under the .git directory as well as the stuff it is meant to copy.

Not sure if this will work, but lib_ignore will ignore a library in the build process. If it’s also ignored in the installation step is something I don’t know.

https://docs.platformio.org/en/latest/projectconf/sections/env/options/library/lib_ignore.html

Thanks for the swift response: unfortunately it is a directory tree within the library, i.e. something I can specify in library.json, that I would like to ignore; lib_ignore (if I’ve read it right) seems to be a property of platformio.ini and expects to take a library name as a parameter and so will then ignore that whole library.

If the git-clone method of getting your library also gets you megabytes worth of .git folder then you could try specifying the .zip download link instead, like https://github.com/arduino-libraries/Ethernet/archive/refs/heads/master.zip. Of course this breaks the git linkage if you were expecting to git push from the downloaded library at a later point.

Yes, normally that would be a solution, it’s just that during development, and potentially if a customer has decided to clone our library and retain it locally rather than specifying a URL, that the problem arises, 'cos you want the .git stuff to be there, you just don’t want it being copied about by the library manager.

I think when the .git to your library is found by PIO it will git clone it, and the git client doesn’t discriminate in what folder it downloads. PIO could only post-delete folders you don’t want after the bandwidth was already spent. But as far as I know, that’s not implemented, so you would need to file an issue in Issues · platformio/platformio-core · GitHub.

Good idea, I will do that.