diff --git a/utils/modifycommand.go b/utils/modifycommand.go index 267139e..3890560 100644 --- a/utils/modifycommand.go +++ b/utils/modifycommand.go @@ -75,7 +75,15 @@ func AssociateFilesWithCommands(files []string, commands []ModifyCommand) (map[s } for _, command := range commands { for _, glob := range command.Files { - matches, err := Matches(file, glob) + _, pattern, err := FigureOutGlobRoot(glob) + if err != nil { + logger.Trace("Failed to figure out glob root for %s: %v", glob, err) + continue + } + file = filepath.Clean(file) + file = strings.ReplaceAll(file, "\\", "/") + + matches, err := Matches(file, pattern) if err != nil { logger.Trace("Failed to match glob %s with file %s: %v", glob, file, err) continue