@@ -72,11 +72,21 @@ func Generate(ctx context.Context) error {
72
72
if n .GrpcConfig .Template == templates .Compage {
73
73
if n .GrpcConfig .Framework == GoGrpcServerFramework {
74
74
goGrpcServerCopier := getGoGrpcServerCopier (goValues )
75
+ // copy all files at root level
76
+ if err := goGrpcServerCopier .CreateRootLevelFiles (); err != nil {
77
+ log .Debugf ("err : %s" , err )
78
+ return err
79
+ }
75
80
if n .GrpcConfig .Server != nil {
76
81
if err := goGrpcServerCopier .CreateGrpcServer (); err != nil {
77
82
log .Debugf ("err : %s" , err )
78
83
return err
79
84
}
85
+ // generate protoc commands on proto file for the code generated
86
+ if err := RunMakeProto (goValues .Values .NodeDirectoryName ); err != nil {
87
+ log .Debugf ("err : %s" , err )
88
+ return err
89
+ }
80
90
}
81
91
if n .GrpcConfig .Clients != nil {
82
92
// grpcConfig.clients - present when client config is provided
@@ -85,16 +95,6 @@ func Generate(ctx context.Context) error {
85
95
return err
86
96
}
87
97
}
88
- // copy all files at root level, fire this at last
89
- if err := goGrpcServerCopier .CreateRootLevelFiles (); err != nil {
90
- log .Debugf ("err : %s" , err )
91
- return err
92
- }
93
- // generate protoc commands on proto file for the code generated
94
- if err := RunMakeProto (goValues .Values .NodeDirectoryName ); err != nil {
95
- log .Debugf ("err : %s" , err )
96
- return err
97
- }
98
98
} else {
99
99
return fmt .Errorf ("unsupported framework %s for template %s for language %s" , n .GrpcConfig .Framework , n .GrpcConfig .Template , n .Language )
100
100
}
0 commit comments