diff --git a/scripts/cra-bundle-stats-diff.py b/scripts/cra-bundle-stats-diff.py index 67d6f9ada..a4b224588 100755 --- a/scripts/cra-bundle-stats-diff.py +++ b/scripts/cra-bundle-stats-diff.py @@ -224,4 +224,5 @@ if __name__ == '__main__': sys.exit(1) diffs = diffBundles(bundleA, bundleB) - printDiff(diffs) + if diffs: + printDiff(diffs) diff --git a/scripts/pr-comment.py b/scripts/pr-comment.py index 99107cf8d..4905eec86 100755 --- a/scripts/pr-comment.py +++ b/scripts/pr-comment.py @@ -82,6 +82,10 @@ if __name__ == '__main__': with open(commentFile) as f: comment = f.read() + if not comment: + print('{path} is empty, exiting'.format(path=commentFile)) + sys.exit(0) + if format == 'noformat': comment = '```\n{body}\n```'.format(body=comment)