From 2434084238053b36362f5808d68bb069ba4c7ff4 Mon Sep 17 00:00:00 2001 From: mappu Date: Wed, 16 Oct 2024 18:05:24 +1300 Subject: [PATCH] genbindings/main: create target directory if not already existing --- cmd/genbindings/main.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/genbindings/main.go b/cmd/genbindings/main.go index a7cbe3bf..a50ea766 100644 --- a/cmd/genbindings/main.go +++ b/cmd/genbindings/main.go @@ -50,6 +50,8 @@ func findHeadersInDir(srcDir string) []string { func cleanGeneratedFilesInDir(dirpath string) { log.Printf("Cleaning up output directory %q...", dirpath) + _ = os.MkdirAll(dirpath, 0755) + existing, err := os.ReadDir(dirpath) if err != nil { panic(err)