mirror of
https://github.com/vitest-dev/vitest.git
synced 2026-02-01 17:36:51 +00:00
chore: avatar size
This commit is contained in:
parent
0b6a0ae8db
commit
e5bf4b04a4
@ -1,11 +1,13 @@
|
||||
import fs from 'fs-extra'
|
||||
import { $fetch } from 'ohmyfetch'
|
||||
import { coreTeamMembers } from '../src/contributors'
|
||||
|
||||
const pathContributors = '../docs/contributors.json'
|
||||
const dirAvatars = '../docs/public/user-avatars/'
|
||||
const dirSponsors = '../docs/public/sponsors/'
|
||||
|
||||
let contributors: string[] = []
|
||||
const team = coreTeamMembers.map(i => i.github)
|
||||
|
||||
async function download(url: string, fileName: string) {
|
||||
const image = await $fetch(url, { responseType: 'arrayBuffer' })
|
||||
@ -16,7 +18,7 @@ async function fetchAvatars() {
|
||||
await fs.ensureDir(dirAvatars)
|
||||
contributors = JSON.parse(await fs.readFile(pathContributors, { encoding: 'utf-8' }))
|
||||
|
||||
await Promise.all(contributors.map(async name => download(`https://github.com/${name}.png`, `${dirAvatars}${name}.png`)))
|
||||
await Promise.all(contributors.map(async name => download(`https://github.com/${name}.png?size${team.includes(name) ? 100 : 40}`, `${dirAvatars}${name}.png`)))
|
||||
}
|
||||
|
||||
async function fetchSponsors() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user