Skip to content
This repository has been archived by the owner on Jun 25, 2022. It is now read-only.

Search for boxes in vendor directory #200

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ajpetersons
Copy link

When dependencies are vendored (not stored in GOPATH or GOROOT), packr is not able to find Boxes. This Change allows locating boxes in vendor directory (excluding github.com/gobuffalo/packr)

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found some fixes!

P.S. share your ideas, feedbacks or issues with us at https://github.com/fixmie/feedback (this message will be removed after the beta stage).

@@ -9,7 +9,7 @@ import (
"github.com/gobuffalo/packr/v2/plog"
)

var DefaultIgnoredFolders = []string{".", "_", "vendor", "node_modules", "_fixtures", "testdata"}
var DefaultIgnoredFolders = []string{".", "_", "node_modules", "_fixtures", "testdata"}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exported identifier "DefaultIgnoredFolders" should have comment

Suggested change
var DefaultIgnoredFolders = []string{".", "_", "node_modules", "_fixtures", "testdata"}
// DefaultIgnoredFolders ...
var DefaultIgnoredFolders = []string{".", "_", "node_modules", "_fixtures", "testdata"}

@davidovich
Copy link
Contributor

I don’t quite understand why you would want to harvest boxes in vendor. Do you want to have a super project and assemble boxes from inner projects?

The way you have modified the code now changes a default that will most certainly surprise the majority of users.

Could you instead modify the public DefaultIgnoredFolders in a cmd of your own ?

@ajpetersons
Copy link
Author

The reason for the change originated in our need to use boxes from one project in another project. But I think the rationale here goes deeper. The existing box resolution logic was able to pick up boxes in GOPATH but not in vendor directory which is Go default import resolution order.

For example, if I have "github.com/x/y" that uses packr boxes in GOPATH, the boxes will be bundled into my binary. But the code Go compiles will be taken from the vendor directory (if it exists) leading to some unexpected behaviour.

If you feel that such a fix would not be globally appropriate, we will keep using our forked version.

@project0
Copy link

Why not just making the ignored folder configurable?

@rbren
Copy link

rbren commented Aug 28, 2019

+1 for something that allows us to pick up packr boxes in the vendor folder.

We need to grab a text template defined in one of our dependencies.

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

Successfully merging this pull request may close these issues.

None yet

4 participants