Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore paths option #24

Closed
tanepiper opened this issue Dec 17, 2012 · 2 comments
Closed

Ignore paths option #24

tanepiper opened this issue Dec 17, 2012 · 2 comments

Comments

@tanepiper
Copy link

Consider that I have a folder structure like this:

myfolder
    - output
    - source
    - theme
    config.json

I'd like to put a watcher on the whole myfolder - but I want to ignore changes in the output folder - ideally when setting up I can do the following:

watchr.watch({
  paths: [
    'myfolder'
  ],
  ignoreFolders: [
    'myfolder/output'
  ]
});
@balupton
Copy link
Member

This is a real good idea.

I'd like to see this accomplish via hooking into the scandir action callbacks, allowing us to actually have a function where the callback err, ignore determines if we should ignore the directory. Something like:

watchr.watch({
  // ...
  events: {
    watchBefore: function(fullPath,next){
      return next(null, /myfolder\/output$/.test(fullPath))
    }
  }
})

Something like that at least. Would you want to tackle this as a pull request?

@balupton
Copy link
Member

balupton commented Jan 8, 2013

Added in v2.3.3 via the ignorePaths: ['/Users/balupton/super-secret-file'] option. Thanks!

@balupton balupton closed this as completed Jan 8, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants