From 299e6d8bfed27be175ecc6bc0b1d3093ab12a71f Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Wed, 30 Jul 2025 14:41:38 +0200 Subject: [PATCH] Fix glob matching when backslashes are used as separators --- .vscode/launch.json | 11 +++++++++++ utils/modifycommand.go | 1 + 2 files changed, 12 insertions(+) diff --git a/.vscode/launch.json b/.vscode/launch.json index 11344c1..1771e74 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -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", + ] } ] } \ No newline at end of file diff --git a/utils/modifycommand.go b/utils/modifycommand.go index 5ae48b1..4503edd 100644 --- a/utils/modifycommand.go +++ b/utils/modifycommand.go @@ -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)