Skip to content

Commit 571f50b

Browse files
committed
ensure persistant html loading
1 parent 60e1bd8 commit 571f50b

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* CommentBox and CommandBodyBox no longer cut off words when starting a new line.
99

1010
### DEBUGGED
11-
11+
* Fix failure to load html page when man page exist but html file missing.
1212

1313
## Version 0.9.0 (Beta)
1414

cmdcompass/man_parser/loader.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,13 @@ def move_and_clean_man_pages(package_name, extract_to, man_dest_folder):
9191
# Not what we are looking for
9292
if os.path.basename(dst_file).split('.')[0] != package_name:
9393
continue
94-
if not os.path.exists(dst_file):
95-
# Decompress and move
96-
with gzip.open(src_file, 'rb') as f_in:
97-
with open(dst_file, 'wb') as f_out:
98-
shutil.copyfileobj(f_in, f_out)
99-
print(f"Decompressed and moved {src_file} to {dst_file}")
100-
os.remove(src_file)
101-
found_page = dst_file
94+
# Decompress and move
95+
with gzip.open(src_file, 'rb') as f_in:
96+
with open(dst_file, 'wb') as f_out:
97+
shutil.copyfileobj(f_in, f_out)
98+
print(f"Decompressed and moved {src_file} to {dst_file}")
99+
os.remove(src_file)
100+
found_page = dst_file
102101

103102
# Clean up the entire extracted directory structure
104103
shutil.rmtree(extract_to)

0 commit comments

Comments
 (0)