From d8e82fb7bc9da6259b158804ae3d8343050c67aa Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Thu, 8 Nov 2012 08:55:04 -0800 Subject: Add non-zero exit code when bad yamls are found instead of returning zero in that case. --- tools/validate-yaml.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tools/validate-yaml.py') diff --git a/tools/validate-yaml.py b/tools/validate-yaml.py index d3218e40..eda59cb8 100755 --- a/tools/validate-yaml.py +++ b/tools/validate-yaml.py @@ -9,6 +9,7 @@ import yaml if __name__ == "__main__": + bads = 0 for fn in sys.argv[1:]: sys.stdout.write("%s" % (fn)) try: @@ -18,3 +19,8 @@ if __name__ == "__main__": sys.stdout.write(" - ok\n") except Exception, e: sys.stdout.write(" - bad (%s)\n" % (e)) + bads += 1 + if bads > 0: + sys.exit(1) + else: + sys.exit(0) -- cgit v1.2.3