(file_path)
| 18 | |
| 19 | |
| 20 | def process_files(file_path): |
| 21 | with open(file_path, 'r', encoding='utf-8') as file: |
| 22 | content = file.read() |
| 23 | version_match = re.search(r'(//\s*@version)(\s+)(\S+)', content) |
| 24 | if version_match: |
| 25 | spaces = version_match.group(2) # 匹配中间的空格数 |
| 26 | old_version = version_match.group(3) # 匹配旧版本号 |
| 27 | updated_line, version_str = make_version_line(old_version, spaces) |
| 28 | print(f"{file_path}:{old_version} (old)") |
| 29 | print(f"{file_path}:{version_str} (new)") |
| 30 | updated_content = content.replace(version_match.group(0), updated_line) |
| 31 | with open(file_path, 'w', encoding='utf-8', newline='\n') as file: |
| 32 | file.write(updated_content) |
| 33 | return version_str |
| 34 | |
| 35 | |
| 36 | def list_userjs(): |
no test coverage detected