From f44b8fc9bfaeeb94af270148a7acdd2df248ccdf Mon Sep 17 00:00:00 2001 From: Jimmy Brisson Date: Wed, 18 May 2016 17:28:33 -0500 Subject: [PATCH] added a check for existance of sources I ran into this earlier today and yesterday: If you spelled something wrong/forgot to tab complete and had build succesfully before it woild silently and incorrectly build successfully --- tools/make.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/make.py b/tools/make.py index 936bfbae11c..81af64dc050 100755 --- a/tools/make.py +++ b/tools/make.py @@ -21,7 +21,7 @@ import sys from time import sleep from shutil import copy -from os.path import join, abspath, dirname +from os.path import join, abspath, dirname, isfile, isdir # Be sure that the tools directory is in the search path ROOT = abspath(join(dirname(__file__), "..")) @@ -46,7 +46,6 @@ except: ps = object() - if __name__ == '__main__': # Parse Options parser = get_default_options_parser() @@ -167,6 +166,11 @@ (options, args) = parser.parse_args() + for path in options.source_dir : + if not isfile(path) and not isdir(path) : + args_error(parser, "[ERROR] you passed \"{}\" to --source, which does not exist". + format(path)) + # Print available tests in order and exit if options.list_tests is True: print '\n'.join(map(str, sorted(TEST_MAP.values())))