(source_path, suffixes)
| 68 | |
| 69 | # 复制多语言文档 |
| 70 | def copy_readme(source_path, suffixes): |
| 71 | if not suffixes: |
| 72 | return |
| 73 | readme_file = os.path.join(source_path, 'README.md') |
| 74 | for suffix in suffixes: |
| 75 | # 跳过中文简体代码(用于脚本元数据信息,有的浏览器默认中文语言代码是`zh`,脚本中不包含`zh`,那脚本管理器显示的语言就是默认的`en`) |
| 76 | if suffix == 'zh': |
| 77 | continue |
| 78 | new_file_name = f'README_{suffix}.md' |
| 79 | new_file_path = os.path.join(source_path, new_file_name) |
| 80 | shutil.copy(readme_file, new_file_path) |
| 81 | |
| 82 | |
| 83 | # GreasyFork API类 |
no test coverage detected