Add catching for invalid file input

This commit is contained in:
MG-5 2022-10-25 00:02:53 +02:00
parent a8a56801a2
commit a8f408941a

View file

@ -80,6 +80,10 @@ def main(*_args):
filesList.sort() filesList.sort()
file_path = os.path.join(file_path, filesList[len(filesList) - 1]) file_path = os.path.join(file_path, filesList[len(filesList) - 1])
else:
print("Please enter a valid json file or the directory containing the json file!")
sys.exit(0)
else: else:
file_path = pathlib.Path(pathlib.Path(__file__).absolute().parent, 'example.json') file_path = pathlib.Path(pathlib.Path(__file__).absolute().parent, 'example.json')