You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by Sebastian Bazley <se...@apache.org> on 2016/02/05 23:26:56 UTC
[whimsy.git] [1/1] Commit b8dbabe: Allow diff output to be suppressed
Commit b8dbabe5ff4767926db09659fcc371b6dbd3b79e:
Allow diff output to be suppressed
Branch: refs/heads/master
Author: Sebb <se...@apache.org>
Committer: Sebb <se...@apache.org>
Pusher: sebb <se...@apache.org>
------------------------------------------------------------
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")