(paths)
| 42 | |
| 43 | |
| 44 | def get_top_path(paths): |
| 45 | paths = sorted(set(paths), key=len) |
| 46 | top_level_paths = [] |
| 47 | for path in paths: |
| 48 | """ |
| 49 | ../chatgpt-code-styling/#readme |
| 50 | ../chatgpt-code-styling/chatgpt-code-styling.user.js |
| 51 | ../chatgpt-code-styling |
| 52 | 只保留,防止多次替换../chatgpt-code-styling |
| 53 | """ |
| 54 | if '/' not in path.strip('./').strip('../'): |
| 55 | top_level_paths.append(path) |
| 56 | elif "README.md" in path: |
| 57 | top_level_paths.append(path) |
| 58 | return top_level_paths |
| 59 | |
| 60 | |
| 61 | for item in docs['files']: |