Fix glob matching when backslashes are used as separators

This commit is contained in:
2025-07-30 14:41:38 +02:00
parent 388822e90a
commit 299e6d8bfe
2 changed files with 12 additions and 0 deletions

11
.vscode/launch.json vendored
View File

@@ -87,6 +87,17 @@
"args": [
"*.yml",
]
},
{
"name": "Launch Package (Minecraft)",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}",
"cwd": "C:/Users/Administrator/Seafile/Games-Minecraft",
"args": [
"cook_tacz.yml",
]
}
]
}

View File

@@ -94,6 +94,7 @@ func AssociateFilesWithCommands(files []string, commands []ModifyCommand) (map[s
}
for _, command := range commands {
for _, glob := range command.Files {
glob = strings.ReplaceAll(glob, "\\", "/")
static, pattern := SplitPattern(glob)
patternFile := strings.Replace(file, static+`/`, "", 1)
matches, err := Matches(patternFile, pattern)