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

"+" event not firing on directory when modifying, adding or removing a file inside given directory #8

Open
m4rch3n1ng opened this issue Jun 28, 2021 · 0 comments

Comments

@m4rch3n1ng
Copy link

the problem

when watching a directory, if a file changes, the directory it is placed within also gets an update, except for the given directory

to reproduce

make a testing directory, write

const CheapWatch = require("cheap-watch") // or a local import
const { join } = require("path")

const watcher = new CheapWatch({ dir: join(__dirname, "testing") })
watcher.init()

watcher.on("+", ({ path, stats }) => stats.isDirectory() && console.log(path))

into any javascript file, run it and then add files to the testing directory. nothing should happen, but if you add a directory into the testing directory and then add files to that directory the name of the new directory should be console-logged

expectation

i would expect cheap-watch to fire an event on the parent directory too, if a file in it would be changed, added or removed

system and version

i am running on Windows 10, 64bit with node version 16.3.0

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

1 participant