Skip to content

Commit 68de861

Browse files
sdsShane da Silva
authored and
Shane da Silva
committed
Display better error when unable to install
When attempting to install Overcommit as part of running the hook, we didn't give an informative error if for whatever reason this install failed. Improve the error message and change the exit status to follow the `sysexits` standard. Change-Id: I91fe79932a93cc9df5a7568fd223287c956e0f27 Reviewed-on: http://gerrit.causes.com/35620 Reviewed-by: Shane da Silva <shane@causes.com> Tested-by: Shane da Silva <shane@causes.com>
1 parent a76f1ac commit 68de861

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

template-dir/hooks/overcommit-hook

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ rescue LoadError
3030
Gem.clear_paths # Reset load paths so newly installed gem is found
3131
require 'overcommit'
3232
else
33-
puts 'Unable to install Overcommit'
34-
exit
33+
puts 'Unable to install Overcommit -- try running `gem install overcommit`'
34+
exit 69 # EX_UNAVAILABLE
3535
end
3636
else
3737
puts 'You chose not to install Overcommit'

0 commit comments

Comments
 (0)