diff --git a/pkg/releaser/releaser.go b/pkg/releaser/releaser.go index 58e1d8c6..3e0ffa0f 100644 --- a/pkg/releaser/releaser.go +++ b/pkg/releaser/releaser.go @@ -108,9 +108,8 @@ func (r *Releaser) UpdateIndexFile() (bool, error) { // if pages-index-path doesn't end with index.yaml we can try and fix it if filepath.Base(r.config.PagesIndexPath) != "index.yaml" { // if path is a directory then add index.yaml - if stat, err := os.Stat(filepath.Join(worktree, r.config.PagesIndexPath)); err == nil && stat.IsDir() { + if err := os.MkdirAll(filepath.Join(worktree, r.config.PagesIndexPath), 0755); err == nil { r.config.PagesIndexPath = filepath.Join(r.config.PagesIndexPath, "index.yaml") - // otherwise error out } else { fmt.Printf("pages-index-path (%s) should be a directory or a file called index.yaml\n", r.config.PagesIndexPath) os.Exit(1) // nolint: gocritic