gobuffalo / packr

The simple and easy way to embed static files into Go binaries.
MIT License
3.41k stars 196 forks source link

Question: how to exclude dirs/files during packing? #189

Open schu opened 5 years ago

schu commented 5 years ago

For example, if I create a new box (with packr v2) like

box := packr.New("foo", "../foo")

but would like to have the ../foo/.git directory with its contents not included in the box, is there a way to do that?

https://github.com/gobuffalo/packr/issues/63#issuecomment-435606947 seems to suggest that there is a way; do you have an example for that approch by any chance?

markbates commented 5 years ago

https://github.com/gobuffalo/packr/blob/master/v2/jam/parser/prospect.go

markbates commented 5 years ago

Sorry, that’s for parsing. You’ll want to create your own store. The video in the README demonstrates how to it.

invidian commented 5 years ago

If I understand correctly, one way would be to just have multiple boxes for each subdirectory. Not optimal solution, but would do as a workaround.