Fix glob matching when backslashes are used as separators
This commit is contained in:
11
.vscode/launch.json
vendored
11
.vscode/launch.json
vendored
@@ -87,6 +87,17 @@
|
|||||||
"args": [
|
"args": [
|
||||||
"*.yml",
|
"*.yml",
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Launch Package (Minecraft)",
|
||||||
|
"type": "go",
|
||||||
|
"request": "launch",
|
||||||
|
"mode": "auto",
|
||||||
|
"program": "${workspaceFolder}",
|
||||||
|
"cwd": "C:/Users/Administrator/Seafile/Games-Minecraft",
|
||||||
|
"args": [
|
||||||
|
"cook_tacz.yml",
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
@@ -94,6 +94,7 @@ func AssociateFilesWithCommands(files []string, commands []ModifyCommand) (map[s
|
|||||||
}
|
}
|
||||||
for _, command := range commands {
|
for _, command := range commands {
|
||||||
for _, glob := range command.Files {
|
for _, glob := range command.Files {
|
||||||
|
glob = strings.ReplaceAll(glob, "\\", "/")
|
||||||
static, pattern := SplitPattern(glob)
|
static, pattern := SplitPattern(glob)
|
||||||
patternFile := strings.Replace(file, static+`/`, "", 1)
|
patternFile := strings.Replace(file, static+`/`, "", 1)
|
||||||
matches, err := Matches(patternFile, pattern)
|
matches, err := Matches(patternFile, pattern)
|
||||||
|
Reference in New Issue
Block a user