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

fix(watchTree): convert options.interval to seconds #113

Merged
merged 1 commit into from
Oct 5, 2016

Conversation

levithomason
Copy link
Collaborator

@levithomason levithomason commented Aug 17, 2016

Fixes #112. interval was only converted to seconds through the CLI. There should be some higher order parseOptions added to handle this kind of thing.

This at least fixes the issue for the time being.

@mikeal review?

@nealstewart
Copy link

nealstewart commented Oct 5, 2016

Please fix this! 👍

@levithomason levithomason merged commit 5ac4690 into master Oct 5, 2016
@levithomason levithomason deleted the fix/watchtree-interval branch October 5, 2016 17:29
@levithomason
Copy link
Collaborator Author

Released as watch@0.19.3

@nealstewart
Copy link

Should you bounce to a major version number? Since this is a breaking API change :)

@mikeal
Copy link
Owner

mikeal commented Oct 5, 2016

+1 for moving to 1.0 anyway, this package is almost as old as npm :)

@levithomason
Copy link
Collaborator Author

Author wins, shipping 1.0

@levithomason
Copy link
Collaborator Author

Shipped 1.0.0, trying to deprecate 0.19.3 but it seems to be hanging. Will let it sit for a bit:

› npm deprecate watch@0.19.3 "Install watch@1.0.0 instead"

@levithomason
Copy link
Collaborator Author

Done

image

@hilko
Copy link

hilko commented Oct 6, 2016

I just upgraded and it stopped working for me, as in it doesn't re-run the command after changes are made. It does run the first time.

At first I thought that the issue was that I had previously set --interval=0.1, but when I changed it to --interval=1 it still doesn't work. Removing --interval altogether does solve the issue.

Am I doing something wrong here, or could this be a bug?

(other than that: love this package. I use it in pretty much every project these days)

@levithomason
Copy link
Collaborator Author

Confirmed, thanks. The CLI is multiplying the interval * 1000, but then passing that to watchTree where it is again multiplied by 1000. So, if you waited 1000 seconds, it would have noticed :/

Fix coming

@levithomason
Copy link
Collaborator Author

@hilko released a fix in watch@1.0.1, let me know

@jbunton-atlassian
Copy link
Contributor

This is still not correct. If you watch multiple directories then the same options object is passed from CLI to watchTree multiple times. watchTree mutates the options.interval each time.

I've raised #126 to fix this.

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 this pull request may close these issues.

readme.mkd is wrong about interval units
5 participants