diff --git a/cmd/rp/cmd/run.go b/cmd/rp/cmd/run.go index 867f949..36ba0cb 100644 --- a/cmd/rp/cmd/run.go +++ b/cmd/rp/cmd/run.go @@ -31,7 +31,7 @@ func init() { runCmd.PersistentFlags().StringVar(&flagBranch, "branch", "main", "") runCmd.PersistentFlags().StringVar(&flagOwner, "owner", "", "") runCmd.PersistentFlags().StringVar(&flagRepo, "repo", "", "") - runCmd.PersistentFlags().StringVar(&flagExtraFiles, "extra-files", "", "") + runCmd.PersistentFlags().StringVar(&flagRepo, "extra-files", "", "") } func run(cmd *cobra.Command, _ []string) error { diff --git a/releaserpleaser.go b/releaserpleaser.go index ba069e8..4bf25f9 100644 --- a/releaserpleaser.go +++ b/releaserpleaser.go @@ -277,19 +277,6 @@ func (rp *ReleaserPleaser) runReconcileReleasePR(ctx context.Context) error { updatedContent = updater.UpdateContent(updatedContent, nextVersion) } - err = file.Truncate(0) - if err != nil { - return fmt.Errorf("failed to replace file content: %w", err) - } - _, err = file.Seek(0, 0) - if err != nil { - return fmt.Errorf("failed to replace file content: %w", err) - } - _, err = file.Write([]byte(updatedContent)) - if err != nil { - return fmt.Errorf("failed to replace file content: %w", err) - } - _, err = worktree.Add(extraFile) if err != nil { return fmt.Errorf("failed to add updated file to git worktree: %w", err) diff --git a/updater.go b/updater.go index f1aab3c..432c7f2 100644 --- a/updater.go +++ b/updater.go @@ -25,12 +25,10 @@ func (u *GenericUpdater) UpdateContent(content, version string) string { output.Grow(len(content)) for _, line := range strings.Split(content, "\n") { if strings.Contains(line, InlineUpdateMarker) { - // We strip the "v" prefix to avoid adding/removing it from the users input. - line = SemVerRegex.ReplaceAllLiteralString(line, strings.TrimPrefix(version, "v")) + line = SemVerRegex.ReplaceAllLiteralString(line, version) } output.WriteString(line) - // TODO: Fix added newline output.WriteByte('\n') }