()
| 54 | ); |
| 55 | |
| 56 | async function getCollaboratorsFromReadme() { |
| 57 | const readmeText = readline.createInterface({ |
| 58 | input: fs.createReadStream(new URL('../README.md', import.meta.url)), |
| 59 | crlfDelay: Infinity, |
| 60 | }); |
| 61 | const returnedArray = []; |
| 62 | let foundCollaboratorHeading = false; |
| 63 | for await (const line of readmeText) { |
| 64 | // If we've found the collaborator heading already, stop processing at the |
| 65 | // next heading. |
| 66 | if (foundCollaboratorHeading && line.startsWith('#')) { |
| 67 | break; |
| 68 | } |
| 69 | |
| 70 | const isCollaborator = foundCollaboratorHeading && line.length; |
| 71 | |
| 72 | if (line === '### Collaborators') { |
| 73 | foundCollaboratorHeading = true; |
| 74 | } |
| 75 | if (line.startsWith(' **') && isCollaborator) { |
| 76 | const [, name, email] = /^ {2}\*\*([^*]+)\*\* <<(.+)>>/.exec(line); |
| 77 | const mailmap = await runGitCommand( |
| 78 | `git check-mailmap '${name} <${email}>'`, |
| 79 | ); |
| 80 | if (mailmap !== `${name} <${email}>`) { |
| 81 | console.log(`README entry for Collaborator does not match mailmap:\n ${name} <${email}> => ${mailmap}`); |
| 82 | } |
| 83 | returnedArray.push({ |
| 84 | name, |
| 85 | email, |
| 86 | mailmap, |
| 87 | }); |
| 88 | } |
| 89 | } |
| 90 | |
| 91 | if (!foundCollaboratorHeading) { |
| 92 | throw new Error('Could not find Collaborator section of README'); |
| 93 | } |
| 94 | |
| 95 | return returnedArray; |
| 96 | } |
| 97 | |
| 98 | async function moveCollaboratorToEmeritus(peopleToMove) { |
| 99 | const readmeText = readline.createInterface({ |
no test coverage detected
searching dependent graphs…