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

Added an event "-e modify" to solve issue #9. #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

baybird
Copy link

@baybird baybird commented Mar 24, 2019

Added an event "-e modify" to solve the #9 issue that doesn't work on Ubuntu 14.04 with inotifywait 3.14.

doen't work on Ubuntu 14.04 with inotifywait 3.14.
@alexedwards
Copy link
Owner

The problem with monitoring both modify and close_wait events is that it seems some text editors trigger both events when a file is saved. So far I've tried, nano, gedit and sublime, and all three editors trigger both events on save.

Even running echo 'hello' >> main.go seems to trigger both events, at least on my machine.

In turn, that unfortunately means that the restart function in the script is called multiple times, unnecessarily, when using those editors.

One solution might be to add some additional logic to the script to ensure that restart is called once for each 'burst' of events (in conjunction with adding the extra -e modify in this PR). But I think both things need to be done at the same time.

Out of interest, what editor / process are you using to modify your main.go file?

@baybird
Copy link
Author

baybird commented Apr 5, 2019

I am using VScode to modify Go file. Also, tried with Atom and Sublime, all editors have the same issue.

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.

2 participants