Cleanup
This commit is contained in:
14
main.go
14
main.go
@@ -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
|
||||
|
Reference in New Issue
Block a user