Skip to content

Commit 28fa185

Browse files
authored
Merge pull request #122 from fosslight/help_fix
Change the default path to find sbom-info.yaml
2 parents 383bcf7 + 400c47d commit 28fa185

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

src/fosslight_source/_help.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
-t <float>\t\t Stop scancode scanning if scanning takes longer than a timeout in seconds.
3131
-c <core>\t\t Select the number of cores to be scanned with ScanCode.
3232
--no_correction\t Enter if you don't want to correct OSS information with sbom-info.yaml
33-
--correct_fpath\t Path to the sbom-info.yaml file"""
33+
--correct_fpath <path> Path to the sbom-info.yaml file"""
3434

3535

3636
def print_version(pkg_name):

src/fosslight_source/cli.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ def main():
4949
format = ""
5050
selected_scanner = ""
5151
correct_mode = True
52-
correct_filepath = os.getcwd()
5352

5453
scanned_result = []
5554
license_list = []
@@ -91,6 +90,7 @@ def main():
9190
selected_scanner = ''.join(args.scanner)
9291
if args.no_correction:
9392
correct_mode = False
93+
correct_filepath = path_to_scan
9494
if args.correct_fpath:
9595
correct_filepath = ''.join(args.correct_fpath)
9696

@@ -160,6 +160,9 @@ def create_report_file(_start_time, scanned_result, license_list, selected_scann
160160
else:
161161
output_path = os.path.abspath(output_path)
162162

163+
if not correct_filepath:
164+
correct_filepath = path_to_scan
165+
163166
if output_file == "":
164167
if output_extension == _json_ext:
165168
output_file = f"fosslight_opossum_src_{_start_time}"

src/fosslight_source/run_scancode.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ def run_scan(path_to_scan, output_file_name="",
3838
_json_ext = ".json"
3939
_start_time = datetime.now().strftime('%y%m%d_%H%M')
4040

41+
if not correct_filepath:
42+
correct_filepath = path_to_scan
43+
4144
success, msg, output_path, output_file, output_extension = check_output_format(output_file_name, format)
4245
if success:
4346
if output_path == "": # if json output with _write_json_file not used, output_path won't be needed.

0 commit comments

Comments
 (0)