Commit b8dbabe5ff4767926db09659fcc371b6dbd3b79e:
    Allow diff output to be suppressed


Branch: refs/heads/master
Author: Sebb <[email protected]>
Committer: Sebb <[email protected]>
Pusher: sebb <[email protected]>

------------------------------------------------------------
www/roster/public_json_common.rb                             | +++++ -
------------------------------------------------------------
6 changes: 5 additions, 1 deletions.
------------------------------------------------------------


diff --git a/www/roster/public_json_common.rb b/www/roster/public_json_common.rb
index 97c5fd3..54f906f 100644
--- a/www/roster/public_json_common.rb
+++ b/www/roster/public_json_common.rb
@@ -17,8 +17,12 @@
 require 'wunderbar'
 Wunderbar.log_level = 'info' # Temporary for testing
 
+# Allow diff output to be suppressed
+@noDiff = ARGV.delete '--nodiff'
+
 GITINFO = ASF.library_gitinfo rescue '?'
 
+
 def public_json_output(info)
   # format as JSON
   results = JSON.pretty_generate(info)
@@ -39,7 +43,7 @@ def public_json_output(info)
     # so first check for file present, but also fail gracefully if there is a 
further issue
     # (if the diff fails we don't want to lose the output entirely)
 
-    if File.exist?(ARGV.first)
+    if File.exist?(ARGV.first) and ! @noDiff
       begin
         out, err, rc = Open3.capture3('diff', '-u', ARGV.first, '-',
           stdin_data: results + "\n")

Reply via email to