1
0
Fork 0
mirror of https://github.com/Luzifer/git-changerelease.git synced 2024-12-20 02:51:16 +00:00

Fix: Need to read the changelog after editing to get new version

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2023-11-29 12:36:48 +01:00
parent 6b67d5129f
commit 178ef361f5
Signed by: luzifer
GPG key ID: D91C3E91E4CAD6F5

View file

@ -241,7 +241,12 @@ func renderLogAndGetVersion(newVersion *semVer, logs []commit) (*semVer, error)
}
// Read back version from changelog file
changelog := strings.Split(string(c), "\n")
newLog, err := readChangelog()
if err != nil {
return nil, fmt.Errorf("reading back changelog after edit: %w", err)
}
changelog := strings.Split(newLog, "\n")
if len(changelog) < 1 {
return nil, errors.New("changelog is empty, no way to read back the version")
}