更新: 2026年03月30日 16:00:01
This commit is contained in:
parent
2003fa15ef
commit
678042c872
35
tools/optimize_inkos_config.py
Normal file
35
tools/optimize_inkos_config.py
Normal file
@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
优化inkos配置,从根源解决重复版本混乱问题
|
||||
"""
|
||||
|
||||
import os
|
||||
import json
|
||||
import shutil
|
||||
from datetime import datetime
|
||||
|
||||
def optimize_inkos_config():
|
||||
"""优化inkos配置文件"""
|
||||
print("🔧 优化inkos配置,解决重复版本混乱问题")
|
||||
print("=" * 60)
|
||||
|
||||
# 配置文件路径
|
||||
config_files = [
|
||||
"/root/.openclaw/workspace/tomato-novel/inkos.json",
|
||||
"/root/.openclaw/workspace/tomato-novel/inkos_quality_config.json",
|
||||
"/root/.openclaw/workspace/tomato-novel/books/末日重生-开局囤货十亿物资/inkos_config.json"
|
||||
]
|
||||
|
||||
# 创建备份目录
|
||||
backup_dir = "/root/.openclaw/workspace/tomato-novel/config_backup"
|
||||
os.makedirs(backup_dir, exist_ok=True)
|
||||
|
||||
for config_file in config_files:
|
||||
if not os.path.exists(config_file):
|
||||
print(f"⚠ 配置文件不存在: {config_file}")
|
||||
continue
|
||||
|
||||
# 创建备份
|
||||
backup_path = os.path.join(backup_dir, f"{os.path.basename(config_file)}.bak.{datetime.now().strftime('%Y%m%d_%H%M%S')}")
|
||||
shutil.copy2(config_file, backup_path)
|
||||
print(f"
|
||||
Loading…
Reference in New Issue
Block a user