Skip to content

Commit 321d9a7

Browse files
author
Ethan Lee
committed
Fix the notice screen
Signed-off-by: Ethan Lee <[email protected]>
1 parent 7fbc0c3 commit 321d9a7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/fosslight_binary/cli.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def get_terminal_size():
2121

2222
def paginate_file(file_path):
2323
lines_per_page = get_terminal_size() - 1
24-
with open(file_path, 'r') as file:
24+
with open(file_path, 'r', encoding='utf8') as file:
2525
lines = file.readlines()
2626

2727
for i in range(0, len(lines), lines_per_page):
@@ -103,8 +103,10 @@ def main():
103103
data_path = os.path.join(base_path, 'LICENSES')
104104
print(f"*** {_PKG_NAME} open source license notice ***")
105105
for ff in os.listdir(data_path):
106-
f = open(os.path.join(data_path, ff), 'r', encoding='utf8')
107-
print(f.read())
106+
source_file = os.path.join(data_path, ff)
107+
destination_file = os.path.join(base_path, ff)
108+
paginate_file(source_file)
109+
shutil.copyfile(source_file, destination_file)
108110
sys.exit(0)
109111

110112
timer = TimerThread()

0 commit comments

Comments
 (0)