Browse files

--compare would break with the -z flag

  • Loading branch information...
1 parent c8fcd18 commit 37f0f15aeef33183354f0568b9c61ac40d695b78 @oreoshake committed Apr 19, 2012
Showing with 8 additions and 6 deletions.
  1. +8 −6 bin/brakeman
View
14 bin/brakeman
@@ -52,16 +52,18 @@ trap("INT") do
exit!
end
-tracker = if options[:previous_results_json]
+if options[:previous_results_json]
vulns = Brakeman.compare options
puts JSON.pretty_generate(vulns)
else
#Run scan and output a report
- Brakeman.run options.merge(:print_report => true, :quiet => options[:quiet])
+ tracker = Brakeman.run options.merge(:print_report => true, :quiet => options[:quiet])
+
+ #Return error code if --exit-on-warn is used and warnings were found
+ if options[:exit_on_warn] and not tracker.checks.all_warnings.empty?
+ exit Brakeman::Warnings_Found_Exit_Code
+ end
end
-#Return error code if --exit-on-warn is used and warnings were found
-if options[:exit_on_warn] and not tracker.checks.all_warnings.empty?
- exit Brakeman::Warnings_Found_Exit_Code
-end
+

0 comments on commit 37f0f15

Please sign in to comment.