Skip to content

Commit 25b3a44

Browse files
committed
Fix bug about dep. arg input when not dep. running
1 parent cdde9c5 commit 25b3a44

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ pytest
33
pytest-cov
44
flake8==3.9.2
55
pytest-flake8
6+
importlib-metadata==4.2.0

src/fosslight_scanner/_get_input.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def ask_to_run(ask_msg):
2525
return return_value in return_true_item
2626

2727

28-
def get_input_mode():
28+
def get_input_mode(mode="all"):
2929
global _PYTHON_VERSION
3030
_PYTHON_VERSION = sys.version_info[0]
3131

@@ -40,7 +40,8 @@ def get_input_mode():
4040
else:
4141
src_path = get_input("Please enter the path to analyze:", "")
4242

43-
dep_arguments = get_input(
44-
"Please enter arguments for dependency analysis:", "")
43+
if mode == "all" or mode == "dependency" or mode == "dep":
44+
dep_arguments = get_input(
45+
"Please enter arguments for dependency analysis:", "")
4546

4647
return src_path, dep_arguments, url_to_analyze

src/fosslight_scanner/fosslight_scanner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ def run_main(mode, path_arg, dep_arguments, output_file_or_dir, file_format, url
333333
run_prechecker = True
334334

335335
if src_path == "" and url_to_analyze == "":
336-
src_path, dep_arguments, url_to_analyze = get_input_mode()
336+
src_path, dep_arguments, url_to_analyze = get_input_mode(mode)
337337

338338
if not hide_progressbar:
339339
timer = TimerThread()

0 commit comments

Comments
 (0)