go.rice
go.rice copied to clipboard
feature request: Support exclude(ignore) using .riceignore
Similar issues: #80 #37
go.rice does not support excluding files and this result in huge binary if you have folders like node_modules, and due to the way rice find boxes (related #47 ), it's hard to specify different box location for same box during development and production. So similar to git and docker, which has .gitignore and .dockeringore, a .riceignore file can be introduced to make rice more flexible without
changing how rice find boxes.
The implementation in docker for dockerignore can be a good start, also there is a dockerignore library
I have already tried it in my own fork in this commit. It works for append zip only, and use the library mentioned above, it works for this small project. Though the behavior is not exactly same as gitingore and only .riceignore file at box root is supported.
I can make a pull request if go.rice is still under development. Thanks~
This would be a great feature, currently having to manually edit my rice-box.go to remove DS_STORE files and others
Has this been implemented?
@at15 If you're still interested in making a PR for this, it would be very welcome.
I think to keep things simple a .riceignore file should only be valid in the root of a box, and is only valid for that box.
Absolute paths in the .riceignore file are relative to the root of the box.
Perhaps we should try to follow the gitignore guidelines for pattern matching.
https://git-scm.com/docs/gitignore
Go has it's own filepath pattern matching as well, but that doesn't seem to support ** for subdirectories?
https://golang.org/pkg/path/filepath/#Match
No, please, not an ignore option, or at least also provide a include-only thing. rice is embedding my project's .git directory by default. This is a terrible default behavior.
@mdone-cloudian Is your .git directory in the assets box you're embedding?
Please be patient, it will take me a couple of days until I can revisit this and give input. We're in release mode here at $WORK.
[Two months later...] Ok, the way I solved it (and I guess it was the original intended method) was to put the files in its own subdir and point rice to it. I find all the example show this, so I guess it was more an error on my side. It's all good now, forget I ever said anything :)