Skip to content

Commit d29d779

Browse files
committed
Better logs
1 parent 96e4dbc commit d29d779

File tree

6 files changed

+7
-4
lines changed

6 files changed

+7
-4
lines changed

cli/template/apply.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func initTemplateApplyCommand() *cobra.Command {
5454
applyCommand.Flags().StringVarP(&flags.templateId, "template-id", "t", "", "Template ID")
5555
applyCommand.Flags().StringVarP(&flags.templatePrefix, "prefix", "p", "", "Prefix to apply to the name of created resources")
5656
applyCommand.Flags().StringVarP(&flags.deviceId, "device-id", "d", "", "Device ID")
57-
applyCommand.Flags().StringVarP(&flags.netCredentials, "network-credentials", "n", "", "Network credentials used to configure device (e.g. WiFi credentials). Supported values: SECRET_SSID | SECRET_OPTIONAL_PASS | SECRET_DEVICE_KEY")
57+
applyCommand.Flags().StringVarP(&flags.netCredentials, "network-credentials", "n", "", "Comma separated network credentials used to configure device with format <key>=<value>. Supported values: SECRET_SSID | SECRET_OPTIONAL_PASS | SECRET_DEVICE_KEY")
5858

5959
applyCommand.MarkFlagRequired("template-id")
6060
applyCommand.MarkFlagRequired("prefix")

cli/template/export.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func initTemplateExportCommand() *cobra.Command {
4141
Long: "Export template to a file",
4242
Run: func(cmd *cobra.Command, args []string) {
4343
if err := runTemplateExportCommand(flags); err != nil {
44-
feedback.Errorf("Error during template export status: %v", err)
44+
feedback.Errorf("Error during template export: %v", err)
4545
os.Exit(errorcodes.ErrGeneric)
4646
}
4747
},

cli/template/import.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func initTemplateImportCommand() *cobra.Command {
4040
Long: "Import a template from a file",
4141
Run: func(cmd *cobra.Command, args []string) {
4242
if err := runTemplateImportCommand(flags); err != nil {
43-
feedback.Errorf("Error during template status: %v", err)
43+
feedback.Errorf("Error during template import: %v", err)
4444
os.Exit(errorcodes.ErrGeneric)
4545
}
4646
},

cli/template/template.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
func NewCommand() *cobra.Command {
2525
templateCommand := &cobra.Command{
2626
Use: "template",
27-
Short: "Custom templates",
27+
Short: "Custom templates.",
2828
Long: "Commands to manage custom templates lifecycle, like import, export and apply.",
2929
}
3030

internal/storage-api/client.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,9 @@ func (c *StorageApiClient) ImportCustomTemplate(templateFile string) (*ImportCus
148148
if templateFile == "" {
149149
return nil, fmt.Errorf("invalid template: no file provided")
150150
}
151+
if !strings.HasSuffix(templateFile, TemplateFileExtension) {
152+
return nil, fmt.Errorf("invalid template: file must have extension %s", TemplateFileExtension)
153+
}
151154

152155
userRequestToken, err := c.src.Token()
153156
if err != nil {

template_ok-rp-with-binaries.tino

-248 KB
Binary file not shown.

0 commit comments

Comments
 (0)