GeertJohan / go.rice

go.rice is a Go package that makes working with resources such as html,js,css,images,templates, etc very easy.
BSD 2-Clause "Simplified" License
2.42k stars 185 forks source link

exclude option for rice #37

Open gertcuykens opened 9 years ago

gertcuykens commented 9 years ago

Can you add a exclude option please so I can specify which files or directories should not be in the *.rice-box.go

GeertJohan commented 9 years ago

Can you elaborate a bit on this request? A box is supposed to be a set of resources that are required by the program, I think the box folder should only contain files that are required by the program.

gertcuykens commented 9 years ago

In polymer you use the vulcanize tool to import all html, js, css files into a build.html to reduce request to the server. So for example in this static directorie https://github.com/HouzuoGuo/tiedot/tree/webjwt/webcp/static I only need bower_components, js, css and the html directorie during development when not vulcanized into a build.html. If I can exclude them it would be much easier to build a final executable that only includes the build.html and img directory if needed.

gertcuykens commented 9 years ago

After the exclude feature, a second request would be for rice to be able to rename files in its *.rice-box.go For example rename build.html to index.html.

My final build script would then look like this

vulcanize -o static/build.html static/index.html
rice embed-go webcp.go -exclude=static/html -exclude=static/js -exclude=static/css -exclude=static/index.html -exclude=static/bower_components
rice mv-go static.rice-box.go build.html index.html
go build
boombuler commented 9 years ago

I would love to have that options too. Or include those files manually. To prevent minified html file in addition to the non-minified html file.

GeertJohan commented 9 years ago

I'm thinking about changing how rice embeds/appends boxes to a binary. Please read and comment on #47 This request sounds like a good idea for it.

pedromorgan commented 5 years ago

Also maybe a flag to exclude . files, eg .sass-cache etc..