Skip to content

Commit b29a588

Browse files
authored
remove piopm file in tl-install folder
1 parent 34ca164 commit b29a588

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

platform.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,15 @@ def wrapper(*args, **kwargs):
110110
return wrapper
111111

112112

113+
@safe_file_operation
114+
def safe_remove_file(path: str) -> bool:
115+
"""Safely remove a file with error handling."""
116+
if os.path.exists(path) and os.path.isfile(path):
117+
os.remove(path)
118+
logger.debug(f"File removed: {path}")
119+
return True
120+
121+
113122
@safe_file_operation
114123
def safe_remove_directory(path: str) -> bool:
115124
"""Safely remove directories with error handling."""
@@ -299,6 +308,8 @@ def _install_tl_install(self, version: str) -> bool:
299308
# Copy tool-esp_install content to tl-install location
300309
if safe_copy_directory(tl_install_path, old_tl_install_path):
301310
logger.info(f"Content copied from {tl_install_name} to old tl-install location")
311+
tl_piopm_path = os.path.join(old_tl_install_path, ".piopm")
312+
safe_remove_file(tl_piopm_path)
302313
else:
303314
logger.warning(f"Failed to copy content to old tl-install location")
304315
return True

0 commit comments

Comments
 (0)