Skip to content

Commit 1a05be7

Browse files
committed
fix(generate): sanitize keyboard name
Replace / with _ to prevent 'file not found' error
1 parent 64b7152 commit 1a05be7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

internal/lib/root.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"image/png"
77
"os"
88
"path"
9+
"strings"
910

1011
"github.com/mrmarble/zmk-viewer/pkg/keyboard"
1112
"github.com/rs/zerolog/log"
@@ -26,6 +27,7 @@ func (g *GenerateCmd) Run() error {
2627
if err != nil {
2728
return err
2829
}
30+
g.KeyboardName = strings.ReplaceAll(g.KeyboardName, "/", "_")
2931

3032
for _, layout := range keyboardInfo {
3133
ctx := createContext(&layout)

0 commit comments

Comments
 (0)