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