(leetcodeId, dirs)
| 80 | } |
| 81 | |
| 82 | function findRepoPath(leetcodeId, dirs) { |
| 83 | const prefix = String(leetcodeId).padStart(4, "0"); |
| 84 | return dirs.find((dir) => { |
| 85 | const name = path.basename(dir); |
| 86 | return name.startsWith(`${prefix}-`) || name.startsWith(`${prefix}_`); |
| 87 | }) || null; |
| 88 | } |
| 89 | |
| 90 | function findFirstGif(dir) { |
| 91 | if (!dir) return null; |