Files
ALL-teach_sys/frontend_能源/fix_nested_comments.py
KQL 38350dca36 更新12个教务系统并优化项目大小
主要更新:
- 更新所有12个产业的教务系统数据和功能
- 删除所有 node_modules 文件夹(节省3.7GB)
- 删除所有 .yoyo 缓存文件夹(节省1.2GB)
- 删除所有 dist 构建文件(节省55MB)

项目优化:
- 项目大小从 8.1GB 减少到 3.2GB(节省60%空间)
- 保留完整的源代码和配置文件
- .gitignore 已配置,防止再次提交大文件

启动脚本:
- start-industry.sh/bat/ps1 脚本会自动检测并安装依赖
- 首次启动时自动运行 npm install
- 支持单个或批量启动产业系统

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-17 14:36:25 +08:00

43 lines
1.2 KiB
Python

#!/usr/bin/env python3
"""
修复CSS文件中的嵌套注释问题
"""
import re
from pathlib import Path
def fix_nested_comments(file_path):
"""修复单个CSS文件中的嵌套注释"""
try:
content = file_path.read_text(encoding='utf-8')
original_content = content
# 匹配嵌套的注释: /* /* ... */ */
# 替换为单层注释: /* ... */
pattern = r'/\*\s*/\*\s*([^*]+(?:\*(?!/)[^*]*)*)\s*\*/\s*\*/'
content = re.sub(pattern, r'/* \1 */', content)
if content != original_content:
file_path.write_text(content, encoding='utf-8')
print(f"已修复: {file_path}")
return True
return False
except Exception as e:
print(f"处理 {file_path} 时出错: {e}")
return False
def main():
"""主函数"""
src_dir = Path('src')
fixed_count = 0
# 遍历所有CSS文件
for css_file in src_dir.rglob('*.css'):
if fix_nested_comments(css_file):
fixed_count += 1
print(f"\n完成!共修复 {fixed_count} 个文件的嵌套注释问题")
if __name__ == '__main__':
print("开始修复CSS文件中的嵌套注释问题...")
main()