Skip to content

Commit 76eb5fd

Browse files
authored
Merge pull request #119 from fosslight/develop
Replace windows operator to '/' for path in yaml
2 parents a12d6f1 + 9bb88af commit 76eb5fd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/fosslight_prechecker/_result.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import os
66
import io
77
import sys
8+
import platform
89
import yaml
910
import fnmatch
1011
import xml.etree.ElementTree as ET
@@ -24,6 +25,7 @@
2425
MSG_FOLLOW_LIC_TXT = "Follow the Copyright and License Writing Rules in Source Code. : " + RULE_LINK
2526
EX_IOERR = 74
2627
logger = logging.getLogger(constant.LOGGER_NAME)
28+
is_windows = platform.system() == 'Windows'
2729

2830

2931
class ResultItem:
@@ -216,7 +218,10 @@ def create_result_file(output_file_name, format='', _start_time=""):
216218

217219

218220
def get_path_in_yaml(oss_item):
219-
return [os.path.join(oss_item.relative_path, file) for file in oss_item.source_name_or_path]
221+
path_in_yaml = [os.path.join(oss_item.relative_path, file) for file in oss_item.source_name_or_path]
222+
if is_windows:
223+
path_in_yaml = [path.replace(os.sep, '/') for path in path_in_yaml]
224+
return path_in_yaml
220225

221226

222227
def extract_files_in_path(remove_file_list, base_file_list, return_found=False):

0 commit comments

Comments
 (0)