Skip to content
This repository was archived by the owner on Jan 5, 2023. It is now read-only.

Commit 4a53bfd

Browse files
author
Sauyon Lee
committed
autobuilder: Only set mod mode when go.mod exists
1 parent 0938437 commit 4a53bfd

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

extractor/cli/go-autobuilder/go-autobuilder.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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 {

0 commit comments

Comments
 (0)