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

Commit b13b54f

Browse files
committed
Don't try to use -mod=... when go.mod doesn't exist
Also don't pass a blank argument to `go` when using an old version.
1 parent 9ad2d6c commit b13b54f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,8 +508,13 @@ func main() {
508508
}
509509

510510
var cmd *exec.Cmd
511-
log.Printf("Running extractor command '%s %s ./...' from directory '%s'.\n", extractor, modMode, cwd)
512-
cmd = exec.Command(extractor, modMode.String(), "./...")
511+
if depMode == GoGetWithModules && modMode.String() != "" {
512+
log.Printf("Running extractor command '%s %s ./...' from directory '%s'.\n", extractor, modMode, cwd)
513+
cmd = exec.Command(extractor, modMode.String(), "./...")
514+
} else {
515+
log.Printf("Running extractor command '%s ./...' from directory '%s'.\n", extractor, cwd)
516+
cmd = exec.Command(extractor, "./...")
517+
}
513518
cmd.Stdout = os.Stdout
514519
cmd.Stderr = os.Stderr
515520
err = cmd.Run()

0 commit comments

Comments
 (0)