mirror of
https://github.com/github/codeql.git
synced 2026-01-29 06:12:58 +01:00
autobuilder: Use -mod=mod for vendor directories wihtout modules.txt
This commit is contained in:
committed by
Chris Smowton
parent
70d425d317
commit
8f6b25e0ac
@@ -244,7 +244,10 @@ func main() {
|
||||
// skip the dependency installation step and run the extractor with `-mod=vendor`
|
||||
if util.FileExists("vendor/modules.txt") {
|
||||
modMode = ModVendor
|
||||
} else if util.DirExists("vendor") {
|
||||
modMode = modModIfSupported()
|
||||
}
|
||||
|
||||
if modMode == ModVendor {
|
||||
// fix go vendor issues with go versions >= 1.14 when no go version is specified in the go.mod
|
||||
// if this is the case, and dependencies were vendored with an old go version (and therefore
|
||||
|
||||
@@ -91,3 +91,12 @@ func FileExists(filename string) bool {
|
||||
}
|
||||
return err == nil && !info.IsDir()
|
||||
}
|
||||
|
||||
// DirExists tests whether `filename` exists and is a directory.
|
||||
func DirExists(filename string) bool {
|
||||
info, err := os.Stat(filename)
|
||||
if err != nil && !os.IsNotExist(err) {
|
||||
log.Printf("Unable to stat %s: %s\n", filename, err.Error())
|
||||
}
|
||||
return err == nil && info.IsDir()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user