feat: add updater for package.json (#213)

This commit is contained in:
Mattis Krämer 2025-08-23 22:05:52 +02:00 committed by GitHub
parent 6237c9b666
commit 1e9e0aa5d9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 174 additions and 44 deletions

View file

@ -6,6 +6,7 @@ import (
"io"
"log/slog"
"os"
"path/filepath"
"time"
"github.com/go-git/go-git/v5"
@ -144,7 +145,7 @@ func (r *Repository) UpdateFile(_ context.Context, path string, create bool, upd
updatedContent := string(content)
for _, update := range updaters {
updatedContent, err = update(updatedContent)
updatedContent, err = update(updatedContent, filepath.Base(path))
if err != nil {
return fmt.Errorf("failed to run updater on file %s", path)
}