Skip to content

Commit c79696f

Browse files
committed
Fixed reports_dir assignment.
Signed-off-by: Caroline Russell <[email protected]>
1 parent 56fe8f6 commit c79696f

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

blint/cli.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,23 +85,20 @@ def main():
8585
src_dir = args.src_dir_image
8686
else:
8787
src_dir = parse_input(args.src_dir_image)
88+
if not src_dir:
89+
src_dir = [os.getcwd()]
8890
if args.reports_dir:
8991
reports_dir = args.reports_dir
90-
elif not src_dir:
91-
reports_base_dir, src_dir= os.getcwd(), [os.getcwd()]
92-
reports_dir = os.path.join(reports_base_dir, "reports")
93-
elif len(src_dir) == 1:
94-
reports_dir = os.path.dirname(src_dir[0])
9592
else:
96-
print("You must use the -o option to specify a reports output directory when scanning multiple sources.")
97-
exit()
98-
for dir in src_dir:
99-
if not os.path.exists(dir):
100-
print(f"{dir} is an invalid file or directory!")
93+
reports_dir = os.path.join(os.getcwd(), "reports")
94+
for src in src_dir:
95+
if not os.path.exists(src):
96+
print(f"{src} is an invalid file or directory!")
10197
return
10298
# Create reports directory
10399
if reports_dir and not os.path.exists(reports_dir):
104100
os.makedirs(reports_dir)
101+
105102
findings, reviews, files, fuzzables = start(args, src_dir, reports_dir)
106103
report(args, src_dir, reports_dir, findings, reviews, files, fuzzables)
107104

0 commit comments

Comments
 (0)