From fe31dbca2642b40850104a7ac53e36cc8811d197 Mon Sep 17 00:00:00 2001 From: Christian Mehlmauer Date: Sun, 8 Dec 2013 08:36:26 +0100 Subject: [PATCH] fix pre-commit hook --- dev/pre-commit-hook.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dev/pre-commit-hook.rb b/dev/pre-commit-hook.rb index 16826b6b..925c80d4 100755 --- a/dev/pre-commit-hook.rb +++ b/dev/pre-commit-hook.rb @@ -1,15 +1,17 @@ #!/usr/bin/env ruby -# ln -sf /Users/xxx/wpscan/.git/hooks/pre-commit +# ln -sf /Users/xxx/wpscan/dev/pre-commit-hook.rb /Users/xxx/wpscan/.git/hooks/pre-commit require 'pty' html_path = 'rspec_results.html' begin - PTY.spawn( 'rspec spec --format h > rspec_results.html' ) do |stdin, stdout, pid| + PTY.spawn( "rspec spec --format h > #{html_path}" ) do |stdin, stdout, pid| begin stdin.each { |line| print line } - rescue Errno::EIO + rescue Errno::EIO => e + puts "Error: #{e.to.s}" + return 1 end end rescue PTY::ChildExited