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

Make the bash script a bit less clumsy on close. #4

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

pope
Copy link

@pope pope commented Mar 16, 2014

When the app closes, the script kills off all inotifywait commands. Well, if you
have have inotifywait commands running on your machine, those get killed! Not
cool. Now, we can just kill all of the processes owned by the script and no one
else.

But app close isn't the only thing addressed. The other thing tackled in here is
an issue where if inotify notices changes faster than the go can recompile, then
you can get into a case where an older version of the app can be running while a
new version may not run because of a conflicting port. The problem was that the
kill command was focusing on the compiled app; but the compilation takes a
little time. So if Go hasn't finished compiling the app, then there's nothing to
kill and Go just compiles the app and runs it. Instead of targetting the running
go program, the script now attempts to kill "go run" and the Go app, if that app
has already started"

Lastly, I added some documentation to the functions in the file. I used the
Google shell style guide[1] in lieu of not knowing what else to use. The nice
part is that the global variables required for each function are documented.

[1] - https://google-styleguide.googlecode.com/svn/trunk/shell.xml

pope added 5 commits March 16, 2014 00:18
When the app closes, the script kills off all inotifywait commands. Well, if you
have have inotifywait commands running on your machine, those get killed! Not
cool. Now, we can just kill all of the processes owned by the script and no one
else.

But app close isn't the only thing addressed. The other thing tackled in here is
an issue where if inotify notices changes faster than the go can recompile, then
you can get into a case where an older version of the app can be running while a
new version may not run because of a conflicting port. The problem was that the
kill command was focusing on the compiled app; but the compilation takes a
little time. So if Go hasn't finished compiling the app, then there's nothing to
kill and Go just compiles the app and runs it. Instead of targetting the running
go program, the script now attempts to kill "go run" and the Go app, if that app
has already started"

Lastly, I added some documentation to the functions in the file. I used the
Google shell style guide[1] in lieu of not knowing what else to use. The nice
part is that the global variables required for each function are documented.

[1] - https://google-styleguide.googlecode.com/svn/trunk/shell.xml
But only do this if the cwd isn't already in the GOPATH.
@pope
Copy link
Author

pope commented Jul 4, 2014

Hi,

I noticed that a month ago you made a fix that this pull request already fixed. I want to know if you're looking for patches? It not, then I will stop worrying about merging your changes and will continue to diverge. Would just like to know either way.

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.

1 participant