This repository has been archived by the owner on Aug 22, 2022. It is now read-only.
Walk function seems to only pack the first alphabetical path #12
Comments
Can you run pkger parse and pkger list and add the output? |
Sure, parse:
List:
|
Update: This seems to be something more general. I tried to change the way I load files by doing Walk only for templates and then use Open to one-by-one add the assets. templatesBox = packd.NewMemoryBox()
// The walker func is the same as the one I had before but extracted for reusability purposes.
err := pkger.Walk("/web/templates/", walker("/web/templates", templatesBox))
if err != nil {
logrus.Error(err)
}
assetsBox = packd.NewMemoryBox()
file, err := pkger.Open("github.com/paganotoni/admon:/web/public/assets/manifest.json")
data, err := ioutil.ReadAll(file)
if err != nil {
logrus.Error(err)
}
assetsBox.AddBytes("manifest.json", data) The output I get from this is it seems the templates folder is no longer being added to the packd files. |
Can you try and simplify the example? Remover packr etc... and write a simple program that just walks those two and prints them out? There are currently too many “variables” in the example.
…--
Mark Bates
On Oct 23, 2019, at 12:02 PM, Antonio Pagano ***@***.***> wrote:
Update: This seems to be something more general. I tried to change the way I load files by doing Walk only for templates and then use Open to one-by-one add the assets.
templatesBox = packd.NewMemoryBox()
err := pkger.Walk("/web/templates/", walker("/web/templates", templatesBox))
if err != nil {
logrus.Error(err)
}
assetsBox = packd.NewMemoryBox()
file, err := pkger.Open("github.com/paganotoni/admon:/web/public/assets/manifest.json")
data, err := ioutil.ReadAll(file)
if err != nil {
logrus.Error(err)
}
assetsBox.AddBytes("manifest.json", data)
The output I get from this is it seems the templates folder is no longer being added to the packd files.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Sure. Let me try and write something |
Wow @markbates that was a great suggestion. I'm thinking this has something to do with |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi @markbates 👋!
Context
I've been trying to use
pkger
as a replacement forpackr2
in a small tool I've been writing (github.com/paganotoni/admon).The things I need to replace initially are the assets and templates Boxes. To do so, I'm walking both paths with
pkger
and filling in apckd.MemoryBox
with those files so buffalo can use them.The problem
The problem i'm facing is that
pkger
seems to only walk through the first path alphabetically. And is ignoring the second one as the following logs show:The text was updated successfully, but these errors were encountered: