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

Pass all paths from event to command ({path} currently replaced by a single path) #71

Closed
sbleon opened this issue Oct 3, 2019 · 0 comments · Fixed by #90
Closed

Pass all paths from event to command ({path} currently replaced by a single path) #71

sbleon opened this issue Oct 3, 2019 · 0 comments · Fixed by #90

Comments

@sbleon
Copy link
Contributor

sbleon commented Oct 3, 2019

The custom command currently only gets a single path when multiple files were changed:

$ node_modules/.bin/chokidar '**/*' -d 0 -c 'echo {path}' &
Watching "**/*" ..
$ touch foo bar baz
File added: foo
File added: bar
File added: baz
baz

I'm not sure if this is a bug or a feature.

If it's a feature

I'd like to see either of these changes:

  1. {path} gets replaced with all of the event's file paths. This could break things for existing users.
  2. {paths} is a new placeholder that gets replaced with all of the event's file paths. This complicates the API.

Any thoughts on which way might be preferable?

If it's a bug

This might be happening because the code is creating a debounced version of the custom command even if the debounce option is set to zero. And/or there might be a similar problem with the throttling. I think it would be simple enough to avoid using those lodash functions if the relevant options are set to zero.

sbleon added a commit to singlebrook/chokidar-cli that referenced this issue Nov 4, 2019
This allows the custom command to be run once for each path modified in a
single event, and resolves open-cli-tools#71.
paulmillr pushed a commit that referenced this issue Nov 5, 2019
This allows the custom command to be run once for each path modified in a
single event, and resolves #71.
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

Successfully merging a pull request may close this issue.

1 participant