Fix some tests and add some logs
This commit is contained in:
7
.vscode/launch.json
vendored
7
.vscode/launch.json
vendored
@@ -12,11 +12,10 @@
|
|||||||
"program": "${workspaceFolder}",
|
"program": "${workspaceFolder}",
|
||||||
"cwd": "C:/Users/Administrator/Seafile/Games-Barotrauma",
|
"cwd": "C:/Users/Administrator/Seafile/Games-Barotrauma",
|
||||||
"args": [
|
"args": [
|
||||||
"loglevel",
|
"-loglevel",
|
||||||
"trace",
|
"trace",
|
||||||
"(?-s)LightComponent!anyrange=\"(!num)\"",
|
"-cook",
|
||||||
"*4",
|
"*.yml",
|
||||||
"**/Outpost*.xml"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
14
main.go
14
main.go
@@ -5,6 +5,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"sort"
|
"sort"
|
||||||
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -80,6 +81,17 @@ func main() {
|
|||||||
globs := utils.AggregateGlobs(commands)
|
globs := utils.AggregateGlobs(commands)
|
||||||
logger.Debug("Aggregated %d globs before deduplication", utils.CountGlobsBeforeDedup(commands))
|
logger.Debug("Aggregated %d globs before deduplication", utils.CountGlobsBeforeDedup(commands))
|
||||||
|
|
||||||
|
for _, command := range commands {
|
||||||
|
logger.Trace("Command: %s", command.Name)
|
||||||
|
logger.Trace("Regex: %s", command.Regex)
|
||||||
|
logger.Trace("Files: %v", command.Files)
|
||||||
|
logger.Trace("Lua: %s", command.Lua)
|
||||||
|
logger.Trace("Git: %t", command.Git)
|
||||||
|
logger.Trace("Reset: %t", command.Reset)
|
||||||
|
logger.Trace("Isolate: %t", command.Isolate)
|
||||||
|
logger.Trace("LogLevel: %s", command.LogLevel)
|
||||||
|
}
|
||||||
|
|
||||||
// Resolve all the files for all the globs
|
// Resolve all the files for all the globs
|
||||||
logger.Info("Found %d unique file patterns", len(globs))
|
logger.Info("Found %d unique file patterns", len(globs))
|
||||||
files, err := utils.ExpandGLobs(globs)
|
files, err := utils.ExpandGLobs(globs)
|
||||||
@@ -271,7 +283,7 @@ func RunIsolateCommands(association utils.FileCommandAssociation, file string, f
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(modifications) == 0 {
|
if len(modifications) == 0 {
|
||||||
logger.Info("No modifications found for file %q", file)
|
logger.Warning("No modifications found for file %q", file)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -2,7 +2,6 @@ package processor
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
|
||||||
"io"
|
"io"
|
||||||
"modify/utils"
|
"modify/utils"
|
||||||
"os"
|
"os"
|
||||||
@@ -38,7 +37,7 @@ func ApiAdaptor(content string, regex string, lua string) (string, int, int, err
|
|||||||
LogLevel: "TRACE",
|
LogLevel: "TRACE",
|
||||||
}
|
}
|
||||||
|
|
||||||
commands, err := ProcessRegex(content, command)
|
commands, err := ProcessRegex(content, command, "test")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", 0, 0, err
|
return "", 0, 0, err
|
||||||
}
|
}
|
||||||
|
@@ -15,7 +15,7 @@ func ApiAdaptor(content string, regex string, lua string) (string, int, int, err
|
|||||||
LogLevel: "TRACE",
|
LogLevel: "TRACE",
|
||||||
}
|
}
|
||||||
|
|
||||||
commands, err := processor.ProcessRegex(content, command)
|
commands, err := processor.ProcessRegex(content, command, "test")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", 0, 0, err
|
return "", 0, 0, err
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user