Skip to content

Commit 5fa8dc4

Browse files
committed
Added catch case for copy function if input dir does not exist
1 parent 01686c5 commit 5fa8dc4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

ssri/ssri.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,15 @@ def main():
358358
filesToSearch = None
359359

360360
if args.copy_all:
361+
if not os.path.exists(args.inputFile[0]):
362+
print(
363+
f"{CRED}! Input directory: {args.inputFile[0]} does not exist - exiting{CEND}"
364+
)
365+
numWarnings += 1
366+
exit()
367+
if os.path.isfile(args.inputFile[0]):
368+
print(f"{CRED}! Input directory: {args.inputFile[0]} is a file, exiting{CEND}")
369+
exit()
361370
copyAllFiles(args.inputFile[0], args.output[0])
362371
noWarnings = True # Turns off warnings as we will be overwriting new copied files anyway
363372

0 commit comments

Comments
 (0)