()
| 72 | } |
| 73 | |
| 74 | async function run() { |
| 75 | console.info('Generating labeler config...') |
| 76 | |
| 77 | // Generate the pairs of package labels and their corresponding paths |
| 78 | const pairs = readPairsFromFs() |
| 79 | |
| 80 | // Always add the docs folder |
| 81 | pairs.push(['documentation', 'docs/**/*']) |
| 82 | |
| 83 | // Convert the pairs into valid yaml |
| 84 | const yamlStr = await generateLabelerYaml(pairs) |
| 85 | |
| 86 | // Write to 'labeler-config.yml' |
| 87 | const configPath = path.resolve('labeler-config.yml') |
| 88 | fs.writeFileSync(configPath, yamlStr, { |
| 89 | encoding: 'utf-8', |
| 90 | }) |
| 91 | |
| 92 | console.info(`Generated labeler config at \`${configPath}\`!`) |
| 93 | return |
| 94 | } |
| 95 | |
| 96 | try { |
| 97 | run().then(() => { |
no test coverage detected