@@ -101,6 +101,7 @@ def run_scanner(src_path, dep_arguments, output_path, keep_raw_data=False,
101101 create_csv = False
102102 final_excel_dir = output_path
103103 success = True
104+ temp_output_fiiles = []
104105 if not remove_src_data :
105106 success , final_excel_dir , result_log = init (output_path )
106107
@@ -129,7 +130,9 @@ def run_scanner(src_path, dep_arguments, output_path, keep_raw_data=False,
129130 - 1 , reuse_lint ,
130131 abs_path , "" , False ,
131132 output_reuse )
132- copy_file (output_reuse , output_path )
133+ success_file , copied_file = copy_file (output_reuse , output_path )
134+ if success_file :
135+ temp_output_fiiles .append (copied_file )
133136
134137 if run_src :
135138 try :
@@ -161,7 +164,9 @@ def run_scanner(src_path, dep_arguments, output_path, keep_raw_data=False,
161164 os .path .join (_output_dir , output_files ["BIN" ]),
162165 "" , db_url )
163166 if success :
164- copy_file (os .path .join (_output_dir , output_files ["BIN_TXT" ]), output_path )
167+ success_file , copied_file = copy_file (os .path .join (_output_dir , output_files ["BIN_TXT" ]), output_path )
168+ if success_file :
169+ temp_output_fiiles .append (copied_file )
165170
166171 if run_dep :
167172 run_dependency (src_path , os .path .join (_output_dir , output_files ["DEP" ]), dep_arguments )
@@ -180,7 +185,8 @@ def run_scanner(src_path, dep_arguments, output_path, keep_raw_data=False,
180185 success , output_files = merge_excels (_output_dir , final_report , create_csv )
181186
182187 if success and output_files :
183- result_log ["Output File" ] = output_files .split ("," )
188+ temp_output_fiiles .extend (output_files .split ("," ))
189+ result_log ["Output File" ] = temp_output_fiiles
184190 else :
185191 logger .error (f"Fail to generate a result file. : { output_files } " )
186192
@@ -251,9 +257,11 @@ def init(output_path=""):
251257
252258def run_main (mode , src_path , dep_arguments , output_file_or_dir , file_format , url_to_analyze , db_url ,
253259 hide_progressbar = False , keep_raw_data = False , num_cores = - 1 ):
260+ global _executed_path
261+
254262 output_file = ""
255- output_path = _executed_path
256263 default_oss_name = ""
264+ _executed_path = os .getcwd ()
257265 try :
258266 success , msg , output_path , output_file , output_extension = check_output_format (output_file_or_dir , file_format )
259267 if not success :
@@ -265,6 +273,8 @@ def run_main(mode, src_path, dep_arguments, output_file_or_dir, file_format, url
265273 run_dep = False
266274 run_reuse = False
267275 remove_downloaded_source = False
276+ if output_path == "" :
277+ output_path = _executed_path
268278
269279 if src_path == "" and url_to_analyze == "" :
270280 src_path , dep_arguments , url_to_analyze = get_input_mode ()
0 commit comments