diff --git a/starport/pkg/cosmosgen/install.go b/starport/pkg/cosmosgen/install.go index 6f0a3f2de3..aeb9555b07 100644 --- a/starport/pkg/cosmosgen/install.go +++ b/starport/pkg/cosmosgen/install.go @@ -12,6 +12,19 @@ import ( // InstallDependencies installs protoc dependencies needed by Cosmos ecosystem. func InstallDependencies(ctx context.Context, appPath string) error { + plugins := []string{ + // installs the gocosmos plugin. + "github.com/regen-network/cosmos-proto/protoc-gen-gocosmos", + + // install Go code generation plugin. + "github.com/golang/protobuf/protoc-gen-go", + + // install grpc-gateway plugins. + "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway", + "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger", + "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2", + } + errb := &bytes.Buffer{} err := cmdrunner. New( @@ -19,22 +32,8 @@ func InstallDependencies(ctx context.Context, appPath string) error { cmdrunner.DefaultWorkdir(appPath), ). Run(ctx, - step.New( - step.Exec( - "go", - "get", - // installs the gocosmos plugin. - "github.com/regen-network/cosmos-proto/protoc-gen-gocosmos", - - // install Go code generation plugin. - "github.com/golang/protobuf/protoc-gen-go", - - // install grpc-gateway plugins. - "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway", - "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger", - "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2", - ), - ), + step.New(step.Exec("go", append([]string{"get"}, plugins...)...)), + step.New(step.Exec("go", append([]string{"install"}, plugins...)...)), ) return errors.Wrap(err, errb.String()) }