@@ -202,14 +202,30 @@ func updateModelsSheet(srv *sheets.Service, cred, sheetId string, values []*Mode
202
202
}
203
203
204
204
func updateComponentsSheet (srv * sheets.Service , cred , sheetId string , values []* ComponentCSV , csvPath string ) error {
205
+ if len (values ) == 0 {
206
+ Log .Info ("No components to append, skipping update" )
207
+ return nil
208
+ }
209
+
205
210
marshalledValues , err := marshalStructToCSValues [ComponentCSV ](values )
206
- Log .Info ("Appending" , len (marshalledValues ), "in the components sheet" )
207
211
if err != nil {
208
212
return err
209
213
}
210
- err = appendSheet (srv , cred , sheetId , ComponentsSheetAppendRange , marshalledValues , csvPath )
211
214
212
- return err
215
+ err = appendSheet (srv , cred , sheetId , ComponentsSheetAppendRange , marshalledValues , csvPath )
216
+ if err != nil {
217
+ return err
218
+ }
219
+
220
+ componentNames := make ([]string , 0 , len (values ))
221
+ modelName := values [0 ].Model
222
+ for _ , comp := range values {
223
+ componentNames = append (componentNames , comp .Component )
224
+ }
225
+ Log .Infof ("Successfully appended %d components for model [%s]: %s" ,
226
+ len (values ), modelName , strings .Join (componentNames , ", " ))
227
+
228
+ return nil
213
229
}
214
230
215
231
func appendSheet (srv * sheets.Service , cred , sheetId , appendRange string , values [][]interface {}, csvPaths ... string ) error {
0 commit comments