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

Rename folder with files sends first unlinkdir and then unlink for all files #1309

Open
yuvallevy135 opened this issue Mar 12, 2024 · 0 comments

Comments

@yuvallevy135
Copy link

Describe the bug

My flow is the following:

  1. create a dir.
  2. create some files in it.
  3. rename the folder.

well get an unlinkdir and only then unlink for all the files.
The problem here when im trying to look for those unlink files the path doesnt exists anymore since the dir was already deleted.
Is there a way to ensure that chokidar will perform unlink for all files under dir and only then the dir itseld?

Thank you!

Versions (please complete the following information):

  • Chokidar version: "chokidar": "~3.5.3",
  • Node version v16.2.0
  • OS version: Mac

To Reproduce:

Steps to reproduce the behavior. Include filename and chokidar config.

Ideally prove a problem by isolating and making it reproducible with a very short sample program, which you could paste here:

const chokidar = require('chokidar');
const fs = require('fs');
// One-liner for files and directories starting with 'test'
chokidar.watch('test*', {}).on('all', (event, path) => {
  console.log(event, path);
});
fs.writeFileSync('test.txt', 'testing 1');
// In a comment describe expected output versus observed problem

Most valuable could be one or more test cases for test.js to demonstrate the problem.

Expected behavior
A clear and concise description of what you expect to happen.

Additional context
Add any other context about the problem here.
Optionally nice to know what project you are working on.

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