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

events has wrong timing and order when using -C (--on-change-only) #967

Closed
GongT opened this issue Jan 18, 2017 · 4 comments
Closed

events has wrong timing and order when using -C (--on-change-only) #967

GongT opened this issue Jan 18, 2017 · 4 comments
Labels
stale no activity for 2 weeks

Comments

@GongT
Copy link

GongT commented Jan 18, 2017

[root@localhost tmp]# nodemon -C --config ./nodemon.json --exec /bin/sh -c "echo 'really started' ; sleep 1000"
[nodemon] 1.11.0
[nodemon] to restart at any time, enter rs
[nodemon] watching: wow.json
start!!!!          <-but nothing started

nodemon wait here, run touch wow.json in another terminal

[nodemon] restarting due to changes...
[nodemon] starting /bin/sh -c "echo 'really started' ; sleep 1000"
really started
start!!!!
restart          <-restart after start 😂I spend so many time to find this bug

nodemon wait here, run touch wow.json in another terminal

[nodemon] restarting due to changes...
restart
[nodemon] starting /bin/sh -c "echo 'really started' ; sleep 1000"
really started
start!!!!

If I trigger more change, the output will same as the last block quote.

The last part is right, first 2 is wrong...

It's also right without -C option.

@remy
Copy link
Owner

remy commented Jan 18, 2017

Um, where does start!!! come from? I can't see it anywhere in the command you're running. Can you share your nodemon.json file too?

@GongT
Copy link
Author

GongT commented Jan 18, 2017

oh...i forgot it... sorry...

{
        "events": {
                "start": "echo 'start!!!!'",
                "restart": "echo restart"
        },
        "restartable": "rs",
        "watch": "wow.json"
}

@remy
Copy link
Owner

remy commented Jan 18, 2017

I'd hazard a guess that the event is firing outside of the conditional that says don't run the command upon startup.

@stale
Copy link

stale bot commented Dec 5, 2017

This issue has been automatically marked as idle and stale because it hasn't had any recent activity. It will be automtically closed if no further activity occurs. If you think this is wrong, or the problem still persists, just pop a reply in the comments and @remy will (try!) to follow up.
Thank you for contributing <3

@stale stale bot added the stale no activity for 2 weeks label Dec 5, 2017
@stale stale bot closed this as completed Dec 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale no activity for 2 weeks
Projects
None yet
Development

No branches or pull requests

2 participants