Skip to content

Commit

Permalink
Keep "vendor.conf" for reference
Browse files Browse the repository at this point in the history
Related to LK4D4#5 this allows a human (or maybe in the future a tool) to see if
what is being vendored by the top-level project is consistent with what the
vendored projects themselves are vendoring.

Signed-off-by: Ian Campbell <[email protected]>
  • Loading branch information
Ian Campbell committed Apr 10, 2017
1 parent 7886540 commit 4848f5d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions clean.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ func isLicenseFile(path string) bool {
return licenseFilesRegexp.MatchString(path) && !isGoFile(path)
}

func isVendorConfFile(path string) bool {
return filepath.Base(path) == "vendor.conf"
}

// cleanVendor removes files from unused packages and non-go files
func cleanVendor(vendorDir string, realDeps []*build.Package) error {
realPaths := make(map[string]bool)
Expand Down Expand Up @@ -103,8 +107,8 @@ func cleanVendor(vendorDir string, realDeps []*build.Package) error {
return nil
}

// keep files for licenses
if isLicenseFile(i.Name()) {
// keep files for licenses and recursive vendoring
if isLicenseFile(i.Name()) || isVendorConfFile(i.Name()) {
return nil
}
// remove files from non-deps, non-go files and test files
Expand Down

0 comments on commit 4848f5d

Please sign in to comment.