Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace windows operator to '/' for path in yaml #119

Merged
merged 1 commit into from
Nov 18, 2022
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
7 changes: 6 additions & 1 deletion src/fosslight_prechecker/_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import os
import io
import sys
import platform
import yaml
import fnmatch
import xml.etree.ElementTree as ET
Expand All @@ -24,6 +25,7 @@
MSG_FOLLOW_LIC_TXT = "Follow the Copyright and License Writing Rules in Source Code. : " + RULE_LINK
EX_IOERR = 74
logger = logging.getLogger(constant.LOGGER_NAME)
is_windows = platform.system() == 'Windows'


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


def get_path_in_yaml(oss_item):
return [os.path.join(oss_item.relative_path, file) for file in oss_item.source_name_or_path]
path_in_yaml = [os.path.join(oss_item.relative_path, file) for file in oss_item.source_name_or_path]
if is_windows:
path_in_yaml = [path.replace(os.sep, '/') for path in path_in_yaml]
return path_in_yaml


def extract_files_in_path(remove_file_list, base_file_list, return_found=False):
Expand Down