From f81bee7a9418ebc05f6a2d3c16eef8e5c05013b8 Mon Sep 17 00:00:00 2001 From: lethosor Date: Sat, 21 Feb 2015 23:06:50 -0500 Subject: [PATCH] Make lint.py fail when the specified path doesn't exist --- travis/lint.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/travis/lint.py b/travis/lint.py index 8e48fe6da..2b41e5987 100644 --- a/travis/lint.py +++ b/travis/lint.py @@ -88,6 +88,9 @@ linters = [NewlineLinter(), TrailingWhitespaceLinter(), TabLinter()] def main(): root_path = os.path.abspath(sys.argv[1] if len(sys.argv) > 1 else '.') + if not os.path.exists(root_path): + print('Nonexistent path: %s' % root_path) + sys.exit(2) fix = (len(sys.argv) > 2 and sys.argv[2] == '--fix') global path_blacklist path_blacklist = map(lambda s: os.path.join(root_path, s), path_blacklist)