Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/fosslight_source/convert_scancode.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def main():
global logger

argv = sys.argv[1:]
path_to_find_bin = os.getcwd()
path_to_find_json = ""
start_time = datetime.now().strftime('%Y-%m-%d_%H-%M-%S')
output_file_name = ""
print_matched_text = False
Expand All @@ -114,14 +114,17 @@ def main():
if opt == "-h":
print_help_msg_convert()
elif opt == "-p":
path_to_find_bin = arg
path_to_find_json = arg
elif opt == "-o":
output_file_name = arg
elif opt == "-m":
print_matched_text = True
except Exception:
print_help_msg_convert()

if path_to_find_json == "":
print_help_msg_convert()

if output_file_name == "":
output_dir = os.getcwd()
oss_report_name = "FOSSLight-Report_" + start_time
Expand All @@ -131,7 +134,7 @@ def main():

logger, _result_log = init_log(os.path.join(output_dir, "fosslight_src_log_" + start_time + ".txt"),
True, logging.INFO, logging.DEBUG, _PKG_NAME)
convert_json_to_excel(path_to_find_bin, oss_report_name, _result_log, print_matched_text)
convert_json_to_excel(path_to_find_json, oss_report_name, _result_log, print_matched_text)


if __name__ == '__main__':
Expand Down