File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -480,9 +480,17 @@ func installDependencies(workspace project.GoWorkspace) {
480480
481481 // get dependencies for all modules
482482 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+
483491 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 )
486494 util .RunCmd (install )
487495 }
488496 }
Original file line number Diff line number Diff line change @@ -85,3 +85,10 @@ func InitModule(path string) *exec.Cmd {
8585 modInit .Dir = path
8686 return modInit
8787}
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