@@ -293,12 +293,14 @@ func main() {
293293 log .Println ("Found glide.yaml, enabling go modules" )
294294 }
295295
296- // if a vendor/modules.txt file exists, we assume that there are vendored Go dependencies, and
297- // skip the dependency installation step and run the extractor with `-mod=vendor`
298- if util .FileExists ("vendor/modules.txt" ) {
299- modMode = ModVendor
300- } else if util .DirExists ("vendor" ) {
301- modMode = ModMod
296+ if depMode == GoGetWithModules {
297+ // if a vendor/modules.txt file exists, we assume that there are vendored Go dependencies, and
298+ // skip the dependency installation step and run the extractor with `-mod=vendor`
299+ if util .FileExists ("vendor/modules.txt" ) {
300+ modMode = ModVendor
301+ } else if util .DirExists ("vendor" ) {
302+ modMode = ModMod
303+ }
302304 }
303305
304306 if modMode == ModVendor {
@@ -453,8 +455,15 @@ func main() {
453455 // try to build the project
454456 buildSucceeded := autobuilder .Autobuild ()
455457
458+ // Build failed or there are still dependency errors; we'll try to install dependencies
459+ // ourselves
456460 if ! buildSucceeded {
457- // Build failed; we'll try to install dependencies ourselves
461+ log .Println ("Build failed, continuing to install dependencies." )
462+
463+ shouldInstallDependencies = true
464+ } else if util .DepErrors ("./..." , modMode .argsForGoVersion (getEnvGoSemVer ())... ) {
465+ log .Println ("Dependencies are still not resolving after the build, continuing to install dependencies." )
466+
458467 shouldInstallDependencies = true
459468 }
460469 } else {
0 commit comments