Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1715c17

Browse files
committedJun 4, 2024·
Fixed output
1 parent afc95a8 commit 1715c17

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed
 

‎command/template/import.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
package template
1919

2020
import (
21-
"github.com/sirupsen/logrus"
22-
21+
"github.com/arduino/arduino-cli/cli/feedback"
2322
"github.com/arduino/arduino-cloud-cli/config"
2423
storageapi "github.com/arduino/arduino-cloud-cli/internal/storage-api"
2524
)
@@ -28,12 +27,14 @@ func ImportCustomTemplate(cred *config.Credentials, filePath string) error {
2827

2928
apiclient := storageapi.NewClient(cred)
3029

31-
_, err := apiclient.ImportCustomTemplate(filePath)
30+
feedback.Printf("Importing template %s", filePath)
31+
32+
templateImported, err := apiclient.ImportCustomTemplate(filePath)
3233
if err != nil {
3334
return err
3435
}
3536

36-
logrus.Infof("Template imported")
37+
feedback.Printf("Template '%s' (%s) imported successfully", templateImported.Name, templateImported.TemplateId)
3738

3839
return nil
3940
}

‎internal/storage-api/dto.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ package storageapi
1919

2020
type (
2121
ImportCustomTemplateResponse struct {
22-
TemplateID string `json:"template_id"`
22+
Message string `json:"message"`
23+
Name string `json:"name"`
24+
TemplateId string `json:"template_id"`
2325
}
2426
)

0 commit comments

Comments
 (0)
Please sign in to comment.