Skip to content

Commit cfe9fbd

Browse files
fix: use only single newline
1 parent 9419e74 commit cfe9fbd

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

cmd/semantic-release/main.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,11 +211,9 @@ func cliHandler(cmd *cobra.Command, args []string) {
211211
if conf.Changelog != "" {
212212
oldFile := make([]byte, 0)
213213
if conf.PrependChangelog {
214-
oldFile, err = ioutil.ReadFile(conf.Changelog)
214+
oldFileData, err := ioutil.ReadFile(conf.Changelog)
215215
if err == nil {
216-
oldFile = append([]byte("\n\n"), oldFile...)
217-
} else {
218-
oldFile = make([]byte, 0)
216+
oldFile = append([]byte("\n"), oldFileData...)
219217
}
220218
}
221219
changelogData := append([]byte(changelogRes), oldFile...)

0 commit comments

Comments
 (0)