go-reload icon indicating copy to clipboard operation
go-reload copied to clipboard

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

Open baybird opened this issue 5 years ago • 3 comments

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

baybird avatar Mar 24 '19 20:03 baybird

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?

alexedwards avatar Mar 27 '19 07:03 alexedwards

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

baybird avatar Apr 05 '19 22:04 baybird