1
0
Fork 0

fix: Undoing some merge issues

This commit is contained in:
Joost De Cock 2021-11-28 17:11:37 +01:00
parent 147f9e40a0
commit ecb599cea7
2 changed files with 166 additions and 375 deletions

View file

@ -35,6 +35,12 @@ const packages = glob.sync('*', {
})
const contributors = fs.readFileSync(path.join(repoPath, 'CONTRIBUTORS.md'), 'utf-8')
const acconfig = JSON.parse(fs.readFileSync(path.join(repoPath, '.all-contributorsrc'), 'utf-8'))
const mainReadme = Mustache.render(
fs.readFileSync(path.join(repoPath, 'config', 'templates', 'readme.main.md'), 'utf-8'),
{ allcontributors: acconfig.contributors.length }
)
fs.writeFileSync(path.join(repoPath, 'README.md'), mainReadme + contributors)
validate(packages, config)
reconfigure(packages, config)
@ -240,7 +246,10 @@ function badges(pkg, config) {
for (let group of ['_all', '_social']) {
markup += "<p align='center'>"
for (let key of Object.keys(config.badges[group])) {
markup += formatBadge(config.badges[group][key], pkg, fullName(pkg, config))
const name = (key === 'contributors')
? acconfig.contributors.length
: pkg
markup += formatBadge(config.badges[group][key], name, fullName(pkg, config))
}
markup += '</p>'
}