fix pre-commit hook
This commit is contained in:
@@ -1,15 +1,17 @@
|
|||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
|
|
||||||
# ln -sf <this file> /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'
|
require 'pty'
|
||||||
html_path = 'rspec_results.html'
|
html_path = 'rspec_results.html'
|
||||||
|
|
||||||
begin
|
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
|
begin
|
||||||
stdin.each { |line| print line }
|
stdin.each { |line| print line }
|
||||||
rescue Errno::EIO
|
rescue Errno::EIO => e
|
||||||
|
puts "Error: #{e.to.s}"
|
||||||
|
return 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
rescue PTY::ChildExited
|
rescue PTY::ChildExited
|
||||||
|
|||||||
Reference in New Issue
Block a user