diff --git a/cmd/asciigen/main.go b/cmd/asciigen/main.go index 09971c2..97863ba 100644 --- a/cmd/asciigen/main.go +++ b/cmd/asciigen/main.go @@ -2,6 +2,7 @@ package main import ( "encoding/json" + "fmt" "log" "os" ) @@ -17,11 +18,6 @@ func main() { log.Fatalln("ENV QMK_KEYMAP empty") } - filenameOut := os.Getenv("OUT") - if filenameOut == "" { - log.Fatalln("ENV OUT empty") - } - bytesInfo, err := os.ReadFile(filenameInfo) if err != nil { log.Fatalln("Failed to read file", filenameInfo, err) @@ -46,8 +42,13 @@ func main() { qmkInfo.Layouts, qmkKeymap, ) + fmt.Println(result) - if err := os.WriteFile(filenameOut, []byte(result), 0o644); err != nil { - log.Fatalln("Failed to write file", filenameOut, err) + // Optional + filenameOut := os.Getenv("OUT") + if filenameOut != "" { + if err := os.WriteFile(filenameOut, []byte(result), 0o644); err != nil { + log.Fatalln("Failed to write file", filenameOut, err) + } } }