Skip to content

Commit 59f5751

Browse files
committed
Merge pull request #113 from theotherjimmy/error-bad-source
added a check for existance of sources
2 parents 23d77e4 + f44b8fc commit 59f5751

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tools/make.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import sys
2222
from time import sleep
2323
from shutil import copy
24-
from os.path import join, abspath, dirname
24+
from os.path import join, abspath, dirname, isfile, isdir
2525

2626
# Be sure that the tools directory is in the search path
2727
ROOT = abspath(join(dirname(__file__), ".."))
@@ -46,7 +46,6 @@
4646
except:
4747
ps = object()
4848

49-
5049
if __name__ == '__main__':
5150
# Parse Options
5251
parser = get_default_options_parser()
@@ -167,6 +166,11 @@
167166

168167
(options, args) = parser.parse_args()
169168

169+
for path in options.source_dir :
170+
if not isfile(path) and not isdir(path) :
171+
args_error(parser, "[ERROR] you passed \"{}\" to --source, which does not exist".
172+
format(path))
173+
170174
# Print available tests in order and exit
171175
if options.list_tests is True:
172176
print '\n'.join(map(str, sorted(TEST_MAP.values())))

0 commit comments

Comments
 (0)