This commit is contained in:
Ubuntu
2026-07-03 16:58:28 +08:00
commit 32b43f85bd
6240 changed files with 1987678 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
#!/usr/bin/env python3
import os
import shutil
# 清理旧目录
target_dir = "/home/ubuntu/nanocode/it_automation"
if os.path.exists(target_dir):
# 只删除空目录
try:
os.rmdir(target_dir)
print(f"已删除空目录: {target_dir}")
except OSError:
print(f"目录非空,跳过删除: {target_dir}")
# 创建新目录结构
os.makedirs(os.path.join(target_dir, "scripts"), exist_ok=True)
os.makedirs(os.path.join(target_dir, "config_templates"), exist_ok=True)
os.makedirs(os.path.join(target_dir, "docs"), exist_ok=True)
print("目录结构创建成功:")
for root, dirs, files in os.walk(target_dir):
level = root.replace(target_dir, '').count(os.sep)
indent = ' ' * 2 * level
print(f'{indent}{os.path.basename(root)}/')
subindent = ' ' * 2 * (level + 1)
for file in files:
print(f'{subindent}{file}')