Fix file associations
It was fucked because we were removing the static path and then cramming that into assications
This commit is contained in:
@@ -86,6 +86,7 @@ func AssociateFilesWithCommands(files []string, commands []ModifyCommand) (map[s
|
||||
fileCommands := make(map[string]FileCommandAssociation)
|
||||
|
||||
for _, file := range files {
|
||||
file = strings.ReplaceAll(file, "\\", "/")
|
||||
fileCommands[file] = FileCommandAssociation{
|
||||
File: file,
|
||||
IsolateCommands: []ModifyCommand{},
|
||||
@@ -94,9 +95,8 @@ func AssociateFilesWithCommands(files []string, commands []ModifyCommand) (map[s
|
||||
for _, command := range commands {
|
||||
for _, glob := range command.Files {
|
||||
static, pattern := SplitPattern(glob)
|
||||
file = strings.ReplaceAll(file, "\\", "/")
|
||||
file = strings.Replace(file, static+`/`, "", 1)
|
||||
matches, err := Matches(file, pattern)
|
||||
patternFile := strings.Replace(file, static+`/`, "", 1)
|
||||
matches, err := Matches(patternFile, pattern)
|
||||
if err != nil {
|
||||
logger.Trace("Failed to match glob %s with file %s: %v", glob, file, err)
|
||||
continue
|
||||
|
Reference in New Issue
Block a user