From 25af6566f699983f091909a95713e9236c7e5158 Mon Sep 17 00:00:00 2001 From: Manish Gupta <59428681+mguptahub@users.noreply.github.com> Date: Mon, 9 Sep 2024 13:43:53 +0530 Subject: [PATCH] Pre release (#1) * Prerelease option added Signed-off-by: Manish Gupta * updated Help content and test case Signed-off-by: Manish Gupta * added folder creation as per pages-index-path Signed-off-by: Manish Gupta --------- Signed-off-by: Manish Gupta --- pkg/releaser/releaser.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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