MCPcopy
hub / github.com/ChinaGodMan/UserScripts / copy_readme

Function copy_readme

utils/script-import-sync.py:70–80  ·  view source on GitHub ↗
(source_path, suffixes)

Source from the content-addressed store, hash-verified

68
69# 复制多语言文档
70def 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类

Callers 1

Calls 1

copyMethod · 0.80

Tested by

no test coverage detected