Closed at15 closed 6 years ago
I think rice has a cleaner api
Test files are not build by go, thus call for FindBox in *_test.go won't be found by rice cli
go build -o Ayi
rice append -i github.com/dyweb/Ayi/util/embed --exec Ayi
no calls to rice.FindBox() or rice.MustFindBox() found in import path `github.com/dyweb/Ayi/util/embed`
Error setting zip offset: exit status 13
But how to add multiple import paths?
For the zip problem
zip -A Ayi
get $ zip -A Ayi
zip warning: central dir not where expected - could not adjust offsets
zip warning: (try -FF)
zip error: Zip file structure invalid (Ayi)
From https://github.com/GeertJohan/go.rice/issues/4
You can currently do this by using rice --import-path
append --exec alpaca.exe. But that will only allow you to append/embed one package. Doing a recursive find in all imported packages is something I thought about before.. Simply finding boxes recursively in packages probably won't work since rice allows relative paths, and so you might get multiple different folders with the same name (e.g. templates folder in different packages). It'll probably require some breaking changes in the way a package is appended/embedded and loaded during execution. Maybe need to append with full (absolute) path's to avoid duplicates. I hope the rice with --import-path will solve your problem. I'll add 'finding boxes in imported packages' to the TODO list.
but multiple packages is supported, by calling -i multiple times? and I need to rename the boxes with prefixes, like app-web-assets
, app-generator-assets
I disabled zip -A
and is currently using my own fork https://github.com/at15/go.rice , though it's better to detect OS, but I don't have test environment, so just make sure windows is working.
use gommon/noodle, which support .noodleignore
https://github.com/dyweb/gommon/pull/47
Decided to use rice for embedding assets
../templates/generator
supported.riceignore
-- old content -- This issue is split from #15. Static content is needed for both web interface and generator.
There are two choices
go-bindata
rice