Skip to content

Commit

Permalink
Follow symlinks
Browse files Browse the repository at this point in the history
Solves #231 and updates the README to match.
  • Loading branch information
ArjhanToteck committed Mar 7, 2024
1 parent dc690bb commit 1168d2a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ watchpack high level API doesn't map directly to watchers. Instead a three level
- The real watchers are created by the `DirectoryWatcher`.
- Files are never watched directly. This should keep the watcher count low.
- Watching can be started in the past. This way watching can start after file reading.
- Symlinks are not followed, instead the symlink is watched.

## API

Expand Down
4 changes: 2 additions & 2 deletions lib/DirectoryWatcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ class DirectoryWatcher extends EventEmitter {
const checkStats = () => {
if (this.closed) return;
this._activeEvents.set(filename, false);
fs.lstat(filePath, (err, stats) => {
fs.stat(filePath, (err, stats) => {
if (this.closed) return;
if (this._activeEvents.get(filename) === true) {
process.nextTick(checkStats);
Expand Down Expand Up @@ -625,7 +625,7 @@ class DirectoryWatcher extends EventEmitter {
}
});
for (const itemPath of itemPaths) {
fs.lstat(itemPath, (err2, stats) => {
fs.stat(itemPath, (err2, stats) => {
if (this.closed) return;
if (err2) {
if (
Expand Down

0 comments on commit 1168d2a

Please sign in to comment.