Skip to content

Commit

Permalink
Fix bug about dep. arg input when not dep. running
Browse files Browse the repository at this point in the history
  • Loading branch information
bjk7119 committed Oct 31, 2022
1 parent cdde9c5 commit 25b3a44
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions requirements-dev.txt
Expand Up @@ -3,3 +3,4 @@ pytest
pytest-cov
flake8==3.9.2
pytest-flake8
importlib-metadata==4.2.0
7 changes: 4 additions & 3 deletions src/fosslight_scanner/_get_input.py
Expand Up @@ -25,7 +25,7 @@ def ask_to_run(ask_msg):
return return_value in return_true_item


def get_input_mode():
def get_input_mode(mode="all"):
global _PYTHON_VERSION
_PYTHON_VERSION = sys.version_info[0]

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

dep_arguments = get_input(
"Please enter arguments for dependency analysis:", "")
if mode == "all" or mode == "dependency" or mode == "dep":
dep_arguments = get_input(
"Please enter arguments for dependency analysis:", "")

return src_path, dep_arguments, url_to_analyze
2 changes: 1 addition & 1 deletion src/fosslight_scanner/fosslight_scanner.py
Expand Up @@ -333,7 +333,7 @@ def run_main(mode, path_arg, dep_arguments, output_file_or_dir, file_format, url
run_prechecker = True

if src_path == "" and url_to_analyze == "":
src_path, dep_arguments, url_to_analyze = get_input_mode()
src_path, dep_arguments, url_to_analyze = get_input_mode(mode)

if not hide_progressbar:
timer = TimerThread()
Expand Down

0 comments on commit 25b3a44

Please sign in to comment.