mirror of
https://github.com/apricote/releaser-pleaser.git
synced 2026-02-11 12:17:04 +00:00
Compare commits
14 commits
1488ecd301
...
09436afe81
| Author | SHA1 | Date | |
|---|---|---|---|
| 09436afe81 | |||
| f753fbc32d | |||
| 7b84b3cdcc | |||
| ad69e252b9 | |||
| c00476684c | |||
| 282c10ad5c | |||
| 828a0884c7 | |||
| fd0c35d6f8 | |||
| 1ff67f4ec8 | |||
| 4d435fa952 | |||
| 8abea51ec8 | |||
| 6b839cfc93 | |||
| 1d1f18cc6b | |||
| 60be374b8b |
3 changed files with 2 additions and 17 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue