Skip to content

Commit

Permalink
fix(generate): sanitize keyboard name
Browse files Browse the repository at this point in the history
Replace / with _ to prevent 'file not found' error
  • Loading branch information
MrMarble committed May 8, 2022
1 parent 64b7152 commit 1a05be7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/lib/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"image/png"
"os"
"path"
"strings"

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

for _, layout := range keyboardInfo {
ctx := createContext(&layout)
Expand Down

0 comments on commit 1a05be7

Please sign in to comment.