mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Go: Check for modules.txt or glide.yaml to exclude vendor dirs
This commit is contained in:
@@ -306,5 +306,6 @@ func fileExists(path string) bool {
|
||||
// Decides if `dirPath` is a vendor directory by testing whether it is called `vendor`
|
||||
// and contains a `modules.txt` file.
|
||||
func IsGolangVendorDirectory(dirPath string) bool {
|
||||
return filepath.Base(dirPath) == "vendor" && fileExists(filepath.Join(dirPath, "modules.txt"))
|
||||
return filepath.Base(dirPath) == "vendor" &&
|
||||
(fileExists(filepath.Join(dirPath, "modules.txt")) || fileExists(filepath.Join(dirPath, "../glide.yaml")))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user