@@ -85,21 +85,26 @@ def main():
8585 logger , _result_log = init_log (os .path .join (output_path , "fosslight_src_log_" + start_time + ".txt" ),
8686 True , logging .INFO , logging .DEBUG , _PKG_NAME , path_to_scan )
8787
88- if selected_scanner == 'scancode' :
89- success , _result_log ["Scan Result" ], scanned_result , license_list = run_scan (path_to_scan , output_file_name ,
90- write_json_file , - 1 , True ,
91- print_matched_text , format , True )
92- elif selected_scanner == 'scanoss' :
93- scanned_result = run_scanoss_py (path_to_scan , output_file_name , format , True , write_json_file )
94- elif selected_scanner == 'all' or selected_scanner == '' :
95- success , _result_log ["Scan Result" ], scanned_result , license_list = run_all_scanners (path_to_scan , output_file_name ,
96- write_json_file , - 1 ,
97- print_matched_text , format , True )
88+ if os .path .isdir (path_to_scan ):
89+
90+ if selected_scanner == 'scancode' :
91+ success , _result_log ["Scan Result" ], scanned_result , license_list = run_scan (path_to_scan , output_file_name ,
92+ write_json_file , - 1 , True ,
93+ print_matched_text , format , True )
94+ elif selected_scanner == 'scanoss' :
95+ scanned_result = run_scanoss_py (path_to_scan , output_file_name , format , True , write_json_file )
96+ elif selected_scanner == 'all' or selected_scanner == '' :
97+ success , _result_log ["Scan Result" ], scanned_result , license_list = run_all_scanners (path_to_scan , output_file_name ,
98+ write_json_file , - 1 ,
99+ print_matched_text , format , True )
100+ else :
101+ print_help_msg_source ()
102+ sys .exit (1 )
103+ create_report_file (start_time , scanned_result , license_list , selected_scanner , print_matched_text ,
104+ output_path , output_file , output_extension )
98105 else :
99- print_help_msg_source ( )
106+ logger . error ( f"Check the path to scan. : { path_to_scan } " )
100107 sys .exit (1 )
101- create_report_file (start_time , scanned_result , license_list , selected_scanner , print_matched_text ,
102- output_path , output_file , output_extension )
103108
104109
105110def create_report_file (start_time , scanned_result , license_list , selected_scanner , need_license = False ,
0 commit comments