File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -480,9 +480,17 @@ func installDependencies(workspace project.GoWorkspace) {
480
480
481
481
// get dependencies for all modules
482
482
for _ , module := range workspace .Modules {
483
+ path := filepath .Dir (module .Path )
484
+
485
+ if util .DirExists (filepath .Join (path , "vendor" )) {
486
+ vendor := toolchain .VendorModule (path )
487
+ log .Printf ("Synchronizing vendor file using `go mod vendor` in %s.\n " , path )
488
+ util .RunCmd (vendor )
489
+ }
490
+
483
491
install = exec .Command ("go" , "get" , "-v" , "./..." )
484
- install .Dir = filepath . Dir ( module . Path )
485
- log .Printf ("Installing dependencies using `go get -v ./...` in `%s`.\n " , filepath . Dir ( module . Path ) )
492
+ install .Dir = path
493
+ log .Printf ("Installing dependencies using `go get -v ./...` in `%s`.\n " , path )
486
494
util .RunCmd (install )
487
495
}
488
496
}
Original file line number Diff line number Diff line change @@ -85,3 +85,10 @@ func InitModule(path string) *exec.Cmd {
85
85
modInit .Dir = path
86
86
return modInit
87
87
}
88
+
89
+ // Constructs a command to run `go mod vendor` in the directory given by `path`.
90
+ func VendorModule (path string ) * exec.Cmd {
91
+ modVendor := exec .Command ("go" , "mod" , "vendor" )
92
+ modVendor .Dir = path
93
+ return modVendor
94
+ }
You can’t perform that action at this time.
0 commit comments