Skip to content

Square brackets in resolved base path leads to matchGlobs in watcher to fails #810

@gamerxp

Description

@gamerxp

Describe the bug

In FiveM you can grouping curtain resource to group by naming the parent directory with surrounded square bracket ([GoodCategoryName])

When full path containing this pattern [Name] It leads to minimatch's matching to fails.

With some digging I've found the plugin will globs with resolve full path with unescaped bracket and passing it to minimatch

C:/Github/Project/[Resource]/ui/src/component/**/*.vue

The [Resource] part will leads to minimatch to fails

Potential fix

  • Maybe escape the square brackets in full path before matching with minimatch

Reproduction

Name the parent directory surrounded by square bracket

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (24) x64 AMD Ryzen 9 5900X 12-Core Processor
    Memory: 37.47 GB / 63.91 GB
  Binaries:
    Node: 22.2.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.11 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 10.9.0 - C:\Program Files\nodejs\npm.CMD
    pnpm: 9.15.0 - ~\AppData\Roaming\npm\pnpm.CMD
  Browsers:
    Chrome: 131.0.6778.140
    Edge: Chromium (127.0.2651.74)
    Internet Explorer: 11.0.22621.3527

Used Package Manager

pnpm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions