Skip to content

Commit

Permalink
Merge pull request #731 from stevekuznetsov/skuznets/ensure-dir
Browse files Browse the repository at this point in the history
🐛 output: ensure the directory exists
  • Loading branch information
k8s-ci-robot committed Oct 4, 2022
2 parents 24d788a + e6e9dbd commit 86faf72
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/genall/output.go
Expand Up @@ -103,7 +103,7 @@ type OutputToDirectory string

func (o OutputToDirectory) Open(_ *loader.Package, itemPath string) (io.WriteCloser, error) {
// ensure the directory exists
if err := os.MkdirAll(string(o), os.ModePerm); err != nil {
if err := os.MkdirAll(filepath.Dir(filepath.Join(string(o), itemPath)), os.ModePerm); err != nil {
return nil, err
}
path := filepath.Join(string(o), itemPath)
Expand Down

0 comments on commit 86faf72

Please sign in to comment.