autobuilder: Only set mod mode when go.mod exists

This commit is contained in:
Sauyon Lee
2020-10-03 13:40:02 -07:00
parent 0938437d13
commit 4a53bfdebf

View File

@@ -293,12 +293,14 @@ func main() {
log.Println("Found glide.yaml, enabling go modules")
}
// if a vendor/modules.txt file exists, we assume that there are vendored Go dependencies, and
// 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 = ModMod
if depMode == GoGetWithModules {
// if a vendor/modules.txt file exists, we assume that there are vendored Go dependencies, and
// 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 = ModMod
}
}
if modMode == ModVendor {