c.Assert(client.Vendor(), qt.IsNil)
graphb.Reset()
c.Assert(client.Graph(&graphb), qt.IsNil)
- expectVendored := `github.com/gohugoio/tests/hugo-modules-basic-test github.com/gohugoio/hugoTestModules1_darwin/modh2_2@v1.4.0+vendor
-github.com/gohugoio/tests/hugo-modules-basic-test github.com/gohugoio/hugoTestModules1_darwin/modh2_2_1v@v1.3.0+vendor
-github.com/gohugoio/tests/hugo-modules-basic-test github.com/gohugoio/hugoTestModules1_darwin/modh2_2_2@v1.3.0+vendor
+ expectVendored := `project github.com/gohugoio/hugoTestModules1_darwin/modh2_2@v1.4.0+vendor
+project github.com/gohugoio/hugoTestModules1_darwin/modh2_2_1v@v1.3.0+vendor
+project github.com/gohugoio/hugoTestModules1_darwin/modh2_2_2@v1.3.0+vendor
`
c.Assert(graphb.String(), qt.Equals, expectVendored)
c.collected = &collected{
seen: make(map[string]bool),
vendored: make(map[string]vendoredModule),
+ gomods: goModules{},
+ }
+
+ if !c.ccfg.IgnoreVendor && c.isVendored(c.ccfg.WorkingDir) {
+ return nil
}
// We may fail later if we don't find the mods.
}
func (c *collector) collect() {
+
if err := c.initModules(); err != nil {
c.err = err
return
}
+func (c *collector) isVendored(dir string) bool {
+ _, err := c.fs.Stat(filepath.Join(dir, vendord, vendorModulesFilename))
+ return err == nil
+}
+
func (c *collector) collectModulesTXT(owner Module) error {
vendorDir := filepath.Join(owner.Dir(), vendord)
filename := filepath.Join(vendorDir, vendorModulesFilename)