floatdrop / gulp-watch

Watch, that actually is an endless stream
MIT License
642 stars 99 forks source link

Watched unexpected filepath #251

Open huangwenjie1208 opened 8 years ago

huangwenjie1208 commented 8 years ago

gulp-watch version: 4.3.9 Globs: "app/assets/**" Filepath: D:\svn\PIMP\CODE\trunk\funds\shrb-funds-h5\addDir Event: all Process CWD: D:\svn\PIMP\CODE\trunk\funds\shrb-funds-h5 Options:

{
  "events": [
    "all"
  ],
  "ignoreInitial": true,
  "readDelay": 10
}
UltCombo commented 8 years ago

Maybe related to #236.

By the way, what is your Node.js version?

huangwenjie1208 commented 8 years ago

Node.js v4.2.1

UltCombo commented 8 years ago

Thanks. This issue is looking quite odd—addDir is one of Chokidar's events.

It seems the culprit is the events: ['all'] option, we are not handling it properly. Can you try unsetting the events option to check if it helps?

UltCombo commented 8 years ago

If anyone wants to try to tackle this, IIRC Chokidar passes a different number of arguments to the callback when listening to the all event, so this logic fails for events: ['all'].

Reverting to how this was handled before 11b16679219b4e083591d476eda978c48fe1918a might solve the issue (listen to all and filter out unwanted events), though I'd still prefer to not listen to unnecessary events.

I'll probably be busy until sunday, but PRs are welcome if anyone really needs this.

edit: typos