Skip to content

Commit 72bed1b

Browse files
committed
Strip spaces from exctracted template names
1 parent 0eb0cc6 commit 72bed1b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

command/dashboard/extract.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ func Extract(params *ExtractParams) error {
6565
if name == "" || !ok {
6666
return errors.New("dashboard template does not have a valid name")
6767
}
68-
outfile := name + "-dashboard" + "." + params.Format
68+
name = strings.Join(strings.Fields(name), "")
69+
outfile := name + "-dashboard." + params.Format
6970
params.Outfile = &outfile
7071
}
7172

command/thing/extract.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ func Extract(params *ExtractParams) error {
6565
if name == "" || !ok {
6666
return errors.New("thing template does not have a valid name")
6767
}
68-
outfile := name + "." + params.Format
68+
name = strings.Join(strings.Fields(name), "")
69+
outfile := name + "-thing." + params.Format
6970
params.Outfile = &outfile
7071
}
7172

0 commit comments

Comments
 (0)