From f606bfb5587913571855e65278fe8a07f4a907a4 Mon Sep 17 00:00:00 2001 From: n8225 Date: Sun, 4 Dec 2016 09:45:28 -0600 Subject: [PATCH] Update Dangerfile --- Dangerfile | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/Dangerfile b/Dangerfile index 0b3d23e1..7cedf891 100644 --- a/Dangerfile +++ b/Dangerfile @@ -9,19 +9,23 @@ warn 'Please update the Pull Request title to contain the script name' if github warn 'Please rebase to get rid of the merge commits in this Pull Request' if git.commits.any? { |c| c.message =~ /^Merge branch 'master'/ } # Check links -require 'json' -results = File.read 'ab-results-README.md-markdown-table.json' -j = JSON.parse results -if j['error']==true +if [ -a ab-results-README.md-markdown-table.json ] + require 'json' + results = File.read 'ab-results-README.md-markdown-table.json' + j = JSON.parse results + if j['error']==true fail j['title'] markdown j['message'] + end end # Check syntax -require 'json' -results = File.read 'syntaxcheck.json' -j = JSON.parse results -if j['error']==true +if [ -a syntaxcheck.json ] + require 'json' + results = File.read 'syntaxcheck.json' + j = JSON.parse results + if j['error']==true fail j['title'] markdown j['message'] -end + end +end