-
Notifications
You must be signed in to change notification settings - Fork 141
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
Fix ignoreDirectoryPattern #116
base: master
Are you sure you want to change the base?
Conversation
@@ -51,6 +51,7 @@ function walk (dir, options, callback) { | |||
if (!enoent) { | |||
if (options.ignoreDotFiles && path.basename(f)[0] === '.') return done && callback(null, callback.files); | |||
if (options.filter && !options.filter(f, stat)) return done && callback(null, callback.files); | |||
if (options.ignoreDirectoryPattern && options.ignoreDirectoryPattern.test(f)) return done && callback(null, callback.files); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think stat.isDirectory()
is necessary, otherwise not only the directories but also the files match to ignoreDirectoryPattern
is also ignored.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI: I also tried to fix this issue. Here is my patch.
As this repository hasn't been maintained for a long time, here is the note for someone wants to use the fixed version of this issue. "dependency":
"watch": "Leonid-Yeromin/watch" (or "kena0ki/watch") |
@kena0ki I've installed your version and ran both of the following scripts:
Neither could get my Do you have an example on how to use this or am I doing it wrong? |
Maybe it's not 'dependency' but 'dependencies'. "dependencies": {
"watch": "Leonid-Yeromin/watch" (or "kena0ki/watch")
} |
I understood what you meant, it's fine, I no longer need a solution. I went with chokidar... I created a script called "watch" whose sole purpose is to run this file: const build = () => {
exec('npm run build')
}
chokidar.watch('.', {
ignored: [
'dist',
'node_modules',
'build.js',
'package.json',
'pnpm-lock.yaml',
'tsconfig.json',
],
ignoreInitial: true,
persistent: true,
}).on('all', () => {
build();
}); I would've love to have it in my scripts, but I'm not too hurt about it, I'm starting to like having a few scripts handy. |
Fix problem with watching directory ignored in ignoreDirectoryPattern
jasmine tests added:
npm test