fix: create release dir in recipe if not exists #660
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
3727c7fa78
commit
74108b0dd9
@ -252,7 +252,14 @@ func getTagCreateOptions(tag string) (git.CreateTagOptions, error) {
|
||||
// addReleaseNotes checks if the release/next release note exists and moves the
|
||||
// file to release/<tag>.
|
||||
func addReleaseNotes(recipe recipe.Recipe, tag string) error {
|
||||
tagReleaseNotePath := path.Join(recipe.Dir, "release", tag)
|
||||
releaseDir := path.Join(recipe.Dir, "release")
|
||||
if _, err := os.Stat(releaseDir); errors.Is(err, os.ErrNotExist) {
|
||||
if err := os.Mkdir(releaseDir, 0755); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
tagReleaseNotePath := path.Join(releaseDir, tag)
|
||||
if _, err := os.Stat(tagReleaseNotePath); err == nil {
|
||||
// Release note for current tag already exist exists.
|
||||
return nil
|
||||
@ -260,7 +267,7 @@ func addReleaseNotes(recipe recipe.Recipe, tag string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
nextReleaseNotePath := path.Join(recipe.Dir, "release", "next")
|
||||
nextReleaseNotePath := path.Join(releaseDir, "next")
|
||||
if _, err := os.Stat(nextReleaseNotePath); err == nil {
|
||||
// release/next note exists. Move it to release/<tag>
|
||||
if internal.Dry {
|
||||
|
Loading…
x
Reference in New Issue
Block a user