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

config option "ignoreList" is seemingly ignored #42

Open
despian opened this issue Apr 27, 2017 · 2 comments
Open

config option "ignoreList" is seemingly ignored #42

despian opened this issue Apr 27, 2017 · 2 comments
Labels

Comments

@despian
Copy link

despian commented Apr 27, 2017

I have added the following to my config file:

"ignoreList": ["*.todo"]

But I still get this in the console when I start the app:

13:34:07 - warn: File cannot be tracked because it is not valid: /Users/matt/Work/sn-scripts/todo.todo

I have also tried the following to no avail:

"ignoreList": ["./*.todo"]
"ignoreList": ["/.*\\.todo/"]
"ignoreList": "*.todo"

The readme states the default value for this property is /[\/\\]\./. I assumed that overriding it would stop this default ignore from working, but if I create ".filename" then this does appear to be ignored. This leads me to believe the property from my config file is maybe being ignored.

@dynamicdan
Copy link
Owner

Hi,

I'm not 100% sure what you need to include BUT I do know that the configuration may require escaping. Below are the important parts of the code that may help you understand how to configure your ignoreList.

Default config in app.js

// ignore hidden files/dirs like .sync_data and full records when watching for changes
constants.chokiWatcherIgnore = [/[\/\\]\./, '**/*' + constants.fullRecordSuffix];

The custom setting overrides the default (completely!!)

    // Apply custom file watcher ignore rules
    if (config.ignoreFiles) {
        constants.chokiWatcherIgnore = config.ignoreFiles;
    }

The anymatch plugin is your best reference for how the "ignored" property works:

var chokiWatcher = chokidar.watch(watchedFolders, {
            persistent: true,
            // ignores use anymatch (https://github.com/es128/anymatch)
            ignored: constants.chokiWatcherIgnore
        })

I hope that helps!

@denv3r
Copy link

denv3r commented Sep 3, 2018

@dynamicdan, thanks!
There is error in docs.
In docs you wrote "ignoreList", but there is "ignoreFiles" in your code =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants