File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,15 @@ def wrapper(*args, **kwargs):
110
110
return wrapper
111
111
112
112
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
+
113
122
@safe_file_operation
114
123
def safe_remove_directory (path : str ) -> bool :
115
124
"""Safely remove directories with error handling."""
@@ -299,6 +308,8 @@ def _install_tl_install(self, version: str) -> bool:
299
308
# Copy tool-esp_install content to tl-install location
300
309
if safe_copy_directory (tl_install_path , old_tl_install_path ):
301
310
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 )
302
313
else :
303
314
logger .warning (f"Failed to copy content to old tl-install location" )
304
315
return True
You can’t perform that action at this time.
0 commit comments