Skip to content

Commit ab82b35

Browse files
authored
Merge pull request #84 from fosslight/convert_temp
Fix the bug that convert mode does not run
2 parents 2790940 + b99a5d1 commit ab82b35

File tree

3 files changed

+414
-5
lines changed

3 files changed

+414
-5
lines changed

src/fosslight_source/convert_scancode.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ def convert_json_to_output_report(scancode_json, output_file_name, need_license=
5353
if not success:
5454
logger.error("Fail to convert scancode: " + msg)
5555
return []
56-
5756
try:
5857
sheet_list = {}
5958
if os.path.isfile(scancode_json):
@@ -86,14 +85,16 @@ def convert_json_to_output_report(scancode_json, output_file_name, need_license=
8685
logger.warning("Error parsing "+file+":" + str(ex))
8786

8887
output_file_without_ext = os.path.join(output_path, output_file)
89-
success_to_write, writing_msg = write_output_file(output_file_without_ext, output_extension, sheet_list)
90-
logger.info("Writing Output file(" + output_file + output_extension + "):" + str(success_to_write) + " " + writing_msg)
88+
success_to_write, writing_msg, result_file = write_output_file(output_file_without_ext, output_extension, sheet_list)
89+
9190
if success_to_write:
92-
result_log["Output file"] = output_file_without_ext + output_extension
91+
result_log["Output file"] = result_file
92+
else:
93+
logger.info(f"Failed to writing Output file :{writing_msg}")
9394

9495
except Exception as ex:
9596
success = False
96-
logger.warning(str(ex))
97+
logger.warning(f"Failed to parsing file:{ex}")
9798

9899
scan_result_msg = str(success) if msg == "" else str(success) + "," + msg
99100
result_log["Scan Result"] = scan_result_msg

0 commit comments

Comments
 (0)