Fix exit-status codes for Guard #216

Merged
merged 3 commits into from Jan 5, 2012

Conversation

Projects
None yet
4 participants
@Maher4Ever
Contributor

Maher4Ever commented Jan 3, 2012

While using Guard I always noticed that it exits with status code "1" even when using the interactor to stop it (My terminal shows failure status codes).
It would be nice to let Guard exit with the right status codes because it is a tool used by a lot of developers.

I've changed the way Guard exits in this commit. Guard doesn't exit the program no more when calling Guard.stop. This has the advantage of being able to use Guard.stop programmatically knowing it won't kill the process.

I felt that the interactor should be the one to exit Guard's process, so now it will call Kernel::exit after it stops all running guards.

When there is an interrupt, Guard will still stop all guards, but now it will use Kernel::abort to return a failure status-code.

The commits will apply nicely and the specs pass: http://travis-ci.org/#!/Maher4Ever/guard

@netzpirat

This comment has been minimized.

Show comment Hide comment
@netzpirat

netzpirat Dec 27, 2011

Very nice. I've picked your cherry.

Very nice. I've picked your cherry.

This comment has been minimized.

Show comment Hide comment
@Maher4Ever

Maher4Ever Dec 27, 2011

Owner

Glad to know this fix is accepted, I was worried about the use of hash instead of which in stty_exists?... That's why I didn't open a pull-request,

Owner

Maher4Ever replied Dec 27, 2011

Glad to know this fix is accepted, I was worried about the use of hash instead of which in stty_exists?... That's why I didn't open a pull-request,

This comment has been minimized.

Show comment Hide comment
@netzpirat

netzpirat Dec 27, 2011

I think hash is perfect, since we're not interested in the path, we're interested only to know if it exit in the path. I've tested this on a Windows 7 VM and my OS X box and it worked fine in both environments (returns true on OS X and false on Windows).

I think hash is perfect, since we're not interested in the path, we're interested only to know if it exit in the path. I've tested this on a Windows 7 VM and my OS X box and it worked fine in both environments (returns true on OS X and false on Windows).

@rymai

This comment has been minimized.

Show comment Hide comment
@rymai

rymai Jan 3, 2012

Member

Cool thanks! 🎁

Member

rymai commented Jan 3, 2012

Cool thanks! 🎁

@thibaudgg

This comment has been minimized.

Show comment Hide comment
@thibaudgg

thibaudgg Jan 4, 2012

Member

Great, thanks!

Member

thibaudgg commented Jan 4, 2012

Great, thanks!

@thibaudgg

This comment has been minimized.

Show comment Hide comment
@thibaudgg

thibaudgg Jan 4, 2012

Member

@Maher4Ever this is ready to be merged?

Member

thibaudgg commented Jan 4, 2012

@Maher4Ever this is ready to be merged?

@Maher4Ever

This comment has been minimized.

Show comment Hide comment
@Maher4Ever

Maher4Ever Jan 5, 2012

Contributor

Yes it is. Just merge the last commit though... the rest is already in Guard's master branch.

Contributor

Maher4Ever commented Jan 5, 2012

Yes it is. Just merge the last commit though... the rest is already in Guard's master branch.

thibaudgg added a commit that referenced this pull request Jan 5, 2012

Merge pull request #216 from Maher4Ever/master
Fix exit-status codes for Guard

@thibaudgg thibaudgg merged commit 60cb69c into guard:master Jan 5, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment