This commit is contained in:
2025-03-27 22:55:52 +01:00
parent f453079c72
commit cc30c2bdcb
6 changed files with 70 additions and 133 deletions

14
main.go
View File

@@ -7,6 +7,7 @@ import (
"sort"
"sync"
"modify/processor"
"modify/utils"
"github.com/go-git/go-git/v5"
@@ -109,7 +110,17 @@ func main() {
modifications := []utils.ReplaceCommand{}
for _, command := range commands {
logger.Info("Processing file %q with command %q", file, command.Pattern)
// TODO: Run processor and return modifications
commands, err := processor.ProcessRegex(fileDataStr, command)
if err != nil {
logger.Error("Failed to process file %q with command %q: %v", file, command.Pattern, err)
return
}
modifications = append(modifications, commands...)
}
if len(modifications) == 0 {
logger.Info("No modifications found for file %q", file)
return
}
// Sort commands in reverse order for safe replacements
@@ -127,6 +138,7 @@ func main() {
return
}
}(file, commands)
wg.Wait()
}
// This will also relieve processor of some of the file loading