From a4fc0bbd7bd7293317be860371979426bbf3eae1 Mon Sep 17 00:00:00 2001 From: fsword Date: Mon, 27 Aug 2012 19:07:41 +0800 Subject: [PATCH] Set exit code when difference is found (compare mode) --- bin/brakeman | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/brakeman b/bin/brakeman index 4d6eb315..6419928c 100755 --- a/bin/brakeman +++ b/bin/brakeman @@ -55,6 +55,9 @@ end if options[:previous_results_json] vulns = Brakeman.compare options.merge(:quiet => options[:quiet]) puts JSON.pretty_generate(vulns) + if options[:exit_on_warn] and (vulns[:new].count + vulns[:fixed].count > 0) + exit Brakeman::Warnings_Found_Exit_Code + end else #Run scan and output a report tracker = Brakeman.run options.merge(:print_report => true, :quiet => options[:quiet]) -- GitLab