filespy icon indicating copy to clipboard operation
filespy copied to clipboard

Matching against root doesn't work on windows

Open zardoy opened this issue 4 years ago • 0 comments

Hi! Thanks for awesome lib, README#Pattern syntax has following example:

Use a leading separator to match against the root. '/*.js' // matches 'a.js' not 'a/b.js'

Does it use cwd as a root?

I'm trying to watch root package.json:

const spy = filespy(process.cwd(), {
    only: ['/package.json'],
}).on('all', (event, path) => console.log(event, path))

console.log(spy.files) // no files being watched on win

This doesn't work on windows, but works on macOS.

filespy(process.cwd(), {
    only: ['package.json'],
}).on('all', (event, path) => console.log(event, path))

However this works on both platforms. Am I missed something?

zardoy avatar Nov 19 '21 00:11 zardoy