1
0
Fork 0

feat(renovate): add directory content verification

- add check_directory_contents function to print directory contents
- integrate directory content check after successful directory rename for better debugging
This commit is contained in:
pooneyy 2025-10-09 03:18:37 +08:00
parent 507ea67665
commit 69559ea186
No known key found for this signature in database
1 changed files with 5 additions and 0 deletions

View File

@ -55,6 +55,10 @@ def replace_version_in_dirname(old_ver_dir : str, new_version : str) -> str:
else: else:
return new_version return new_version
def check_directory_contents(check_dir):
print(f"{check_dir} 目录内容:")
for item in os.listdir(check_dir):
print(f" - {item}")
def safe_rename_directory(old_path: str, new_path: str) -> bool: def safe_rename_directory(old_path: str, new_path: str) -> bool:
""" """
@ -81,6 +85,7 @@ def safe_rename_directory(old_path: str, new_path: str) -> bool:
# 验证重命名是否成功 # 验证重命名是否成功
if os.path.exists(new_path) and not os.path.exists(old_path): if os.path.exists(new_path) and not os.path.exists(old_path):
check_directory_contents(new_path)
print(f"✓ 重命名成功") print(f"✓ 重命名成功")
return True return True
else: else: