fix (arm): generator issue on arm

This commit is contained in:
MickaelK 2024-09-18 01:18:30 +10:00
parent 56c5a4f385
commit 05176b8cd1
2 changed files with 12 additions and 4 deletions

View file

@ -16,7 +16,7 @@ import (
"github.com/gorilla/mux"
)
//go:generate sh -c "go run ../generator/emacs-el.go > export_generated.go && go fmt export_generated.go"
//go:generate go run ../generator/emacs-el.go
var EmacsElConfig string = ""
func FileExport(ctx *App, res http.ResponseWriter, req *http.Request) {

View file

@ -21,11 +21,19 @@ func main() {
os.Exit(1)
}
fmt.Printf(`package ctrl
f, err = os.OpenFile("./export_generated.go", os.O_CREATE|os.O_WRONLY, os.ModePerm)
if err != nil {
fmt.Fprintf(os.Stderr, "error: %v\n", err)
os.Exit(1)
return
}
f.Write([]byte(fmt.Sprintf(`package ctrl
func init() {
EmacsElConfig = `+"`"+`
%s
`+"`"+`
`+"`"+`
}
`, j)
`, j)))
f.Close()
}