Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: Support exclude(ignore) using .riceignore #83

Open
at15 opened this issue Aug 21, 2016 · 7 comments
Open

feature request: Support exclude(ignore) using .riceignore #83

at15 opened this issue Aug 21, 2016 · 7 comments

Comments

@at15
Copy link

at15 commented Aug 21, 2016

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~

@ThomasDotCodes
Copy link

This would be a great feature, currently having to manually edit my rice-box.go to remove DS_STORE files and others

@nadilas
Copy link

nadilas commented Feb 24, 2018

Has this been implemented?

@GeertJohan
Copy link
Owner

@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

This was referenced Dec 29, 2018
@mdione-cloudian
Copy link

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.

@GeertJohan
Copy link
Owner

@mdone-cloudian Is your .git directory in the assets box you're embedding?

@mdione-cloudian
Copy link

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.

@mdione-cloudian
Copy link

[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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants