Skip to content

Commit fef96c7

Browse files
committed
fix the error
Signed-off-by: Jiyeong Seok <[email protected]>
1 parent dceb31a commit fef96c7

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

src/fosslight_scanner/_run_compare.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ def write_compared_result(output_file, compared_result, file_ext, before_yaml=''
193193

194194
return success, output_file
195195

196+
196197
def get_comparison_result_filename(output_path, output_file, output_extension, _start_time):
197198
result_file = ""
198199
if output_file != "":

src/fosslight_scanner/cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ def main():
1313
parser.add_argument('mode', nargs='?', help='source| dependency| binary| reuse| all| compare', default="all")
1414
parser.add_argument('--path', '-p', help='Path to analyze', type=str, dest='path', default="")
1515
parser.add_argument('--wget', '-w', help='Link to be analyzed', type=str, dest='link', default="")
16-
parser.add_argument('--file', '-f', help='Output file format (excel, yaml), Compare mode (excel, html, yaml, json)', type=str, dest='file', default="")
16+
parser.add_argument('--file', '-f', help='Scanner output file format (excel,yaml), Compare mode (excel,html,yaml,json)',
17+
type=str, dest='file', default="")
1718
parser.add_argument('--output', '-o', help='Output directory or file', type=str, dest='output', default="")
1819
parser.add_argument('--dependency', '-d', help='Dependency arguments', type=str, dest='dep_argument', default="")
1920
parser.add_argument('--url', '-u', help="DB Url", type=str, dest='db_url', default="")

src/fosslight_scanner/fosslight_scanner.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -189,13 +189,12 @@ def run_scanner(src_path, dep_arguments, output_path, keep_raw_data=False,
189189
if remove_src_data:
190190
overwrite_excel(_output_dir, default_oss_name, "OSS Name")
191191
overwrite_excel(_output_dir, url, "Download Location")
192-
success, output_files = merge_excels(_output_dir, final_report)
192+
success, err_msg = merge_excels(_output_dir, final_report)
193193

194-
if success and output_files:
195-
temp_output_fiiles.extend(output_files.split(","))
196-
result_log["Output File"] = temp_output_fiiles
194+
if success:
195+
result_log["Output File"] = final_report
197196
else:
198-
logger.error(f"Fail to generate a result file. : {output_files}")
197+
logger.error(f"Fail to generate a result file({final_report}): {err_msg}")
199198

200199
_str_final_result_log = yaml.safe_dump(result_log, allow_unicode=True, sort_keys=True)
201200
logger.info(_str_final_result_log)
@@ -275,7 +274,8 @@ def run_main(mode, src_path, dep_arguments, output_file_or_dir, file_format, url
275274
if mode == "compare":
276275
CUSTOMIZED_FORMAT = {'excel': '.xlsx', 'html': '.html', 'json': '.json', 'yaml': '.yaml'}
277276

278-
success, msg, output_path, output_file, output_extension = check_output_format(output_file_or_dir, file_format, CUSTOMIZED_FORMAT)
277+
success, msg, output_path, output_file, output_extension = check_output_format(output_file_or_dir, file_format,
278+
CUSTOMIZED_FORMAT)
279279
if not success:
280280
logger.error(msg)
281281
sys.exit(1)

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ deps =
3636

3737
commands =
3838
fosslight -h
39-
fosslight all -o test_result_local_path/test.csv -p tests -r
39+
fosslight all -o test_result_local_path/test.xlsx -p tests -r
4040
fosslight source -o test_result_wget -w "https://github.com/LGE-OSS/example.git"
4141
pytest -v --flake8

0 commit comments

Comments
 (0)