Skip to content

Commit 7441ba6

Browse files
Remove OS checking routine for windows
1 parent 469218c commit 7441ba6

File tree

2 files changed

+0
-18
lines changed

2 files changed

+0
-18
lines changed

src/fosslight_source/run_scancode.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import os
77
import multiprocessing
88
import warnings
9-
import platform
109
import logging
1110
import yaml
1211
from scancode import cli
@@ -15,7 +14,6 @@
1514
from fosslight_util.set_log import init_log
1615
from ._parsing_scancode_file_item import parsing_file_item
1716
from ._parsing_scancode_file_item import get_error_from_header
18-
from ._help import print_help_msg_source
1917
from ._license_matched import get_license_list_to_print
2018
from fosslight_util.output_format import check_output_format, write_output_file
2119

@@ -37,7 +35,6 @@ def run_scan(path_to_scan, output_file_name="",
3735
license_list = []
3836
_json_ext = ".json"
3937

40-
_windows = platform.system() == "Windows"
4138
start_time = datetime.now().strftime('%Y%m%d_%H%M%S')
4239

4340
success, msg, output_path, output_file, output_extension = check_output_format(output_file_name, format)
@@ -63,12 +60,6 @@ def run_scan(path_to_scan, output_file_name="",
6360
logger, _result_log = init_log(os.path.join(output_path, f"fosslight_src_log_{start_time}.txt"),
6461
True, logging.INFO, logging.DEBUG, _PKG_NAME, path_to_scan)
6562

66-
if path_to_scan == "":
67-
if _windows:
68-
path_to_scan = os.getcwd()
69-
else:
70-
print_help_msg_source()
71-
7263
num_cores = multiprocessing.cpu_count() - 1 if num_cores < 0 else num_cores
7364

7465
if os.path.isdir(path_to_scan):

src/fosslight_source/run_scanoss.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
from ._parsing_scanoss_file import parsing_extraInfo # scanoss
1717
import shutil
1818
from pathlib import Path
19-
import platform
20-
from ._help import print_help_msg_source
2119

2220
logger = logging.getLogger(constant.LOGGER_NAME)
2321
warnings.filterwarnings("ignore", category=FutureWarning)
@@ -43,20 +41,13 @@ def run_scanoss_py(path_to_scan, output_file_name="", format="", called_by_cli=F
4341
:return scanoss_file_list: list of ScanItem (scanned result by files).
4442
"""
4543
success, msg, output_path, output_file, output_extension = check_output_format(output_file_name, format)
46-
_windows = platform.system() == "Windows"
4744

4845
if not called_by_cli:
4946
global logger
5047
start_time = datetime.now().strftime('%Y%m%d_%H%M%S')
5148
logger, _result_log = init_log(os.path.join(output_path, f"fosslight_src_log_{start_time}.txt"),
5249
True, logging.INFO, logging.DEBUG, _PKG_NAME, path_to_scan)
5350

54-
if path_to_scan == "":
55-
if _windows:
56-
path_to_scan = os.getcwd()
57-
else:
58-
print_help_msg_source()
59-
6051
scanoss_file_list = []
6152
try:
6253
pkg_resources.get_distribution("scanoss")

0 commit comments

Comments
 (0)