diff --git a/src/fosslight_source/_help.py b/src/fosslight_source/_help.py index 6ac1748..3b77321 100644 --- a/src/fosslight_source/_help.py +++ b/src/fosslight_source/_help.py @@ -30,7 +30,7 @@ -t \t\t Stop scancode scanning if scanning takes longer than a timeout in seconds. -c \t\t Select the number of cores to be scanned with ScanCode. --no_correction\t Enter if you don't want to correct OSS information with sbom-info.yaml - --correct_fpath\t Path to the sbom-info.yaml file""" + --correct_fpath Path to the sbom-info.yaml file""" def print_version(pkg_name): diff --git a/src/fosslight_source/cli.py b/src/fosslight_source/cli.py index 94e8610..a30dcde 100755 --- a/src/fosslight_source/cli.py +++ b/src/fosslight_source/cli.py @@ -49,7 +49,6 @@ def main(): format = "" selected_scanner = "" correct_mode = True - correct_filepath = os.getcwd() scanned_result = [] license_list = [] @@ -91,6 +90,7 @@ def main(): selected_scanner = ''.join(args.scanner) if args.no_correction: correct_mode = False + correct_filepath = path_to_scan if args.correct_fpath: correct_filepath = ''.join(args.correct_fpath) @@ -160,6 +160,9 @@ def create_report_file(_start_time, scanned_result, license_list, selected_scann else: output_path = os.path.abspath(output_path) + if not correct_filepath: + correct_filepath = path_to_scan + if output_file == "": if output_extension == _json_ext: output_file = f"fosslight_opossum_src_{_start_time}" diff --git a/src/fosslight_source/run_scancode.py b/src/fosslight_source/run_scancode.py index 9ca6eee..ba8c608 100755 --- a/src/fosslight_source/run_scancode.py +++ b/src/fosslight_source/run_scancode.py @@ -38,6 +38,9 @@ def run_scan(path_to_scan, output_file_name="", _json_ext = ".json" _start_time = datetime.now().strftime('%y%m%d_%H%M') + if not correct_filepath: + correct_filepath = path_to_scan + success, msg, output_path, output_file, output_extension = check_output_format(output_file_name, format) if success: if output_path == "": # if json output with _write_json_file not used, output_path won't be needed.