mirror of
https://github.com/apricote/releaser-pleaser.git
synced 2026-01-13 13:21:00 +00:00
refactor: move changelog file to updater interface (#15)
This commit is contained in:
parent
47de2f97bc
commit
f0eed8cc56
5 changed files with 79 additions and 151 deletions
|
|
@ -250,11 +250,6 @@ func (rp *ReleaserPleaser) runReconcileReleasePR(ctx context.Context) error {
|
|||
// Info for updaters
|
||||
info := ReleaseInfo{Version: nextVersion, ChangelogEntry: changelogEntry}
|
||||
|
||||
err = UpdateChangelogFile(worktree, changelogEntry)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to update changelog file: %w", err)
|
||||
}
|
||||
|
||||
updateFile := func(path string, updaters []Updater) error {
|
||||
file, err := worktree.Filesystem.OpenFile(path, os.O_RDWR, 0)
|
||||
if err != nil {
|
||||
|
|
@ -297,6 +292,11 @@ func (rp *ReleaserPleaser) runReconcileReleasePR(ctx context.Context) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
err = updateFile(ChangelogFile, []Updater{&ChangelogUpdater{}})
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to update changelog file: %w", err)
|
||||
}
|
||||
|
||||
for _, path := range rp.extraFiles {
|
||||
_, err = worktree.Filesystem.Stat(path)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue